javatools.parsers
Class RegularExpression.RegExState

java.lang.Object
  extended by javatools.parsers.RegularExpression.RegExState
All Implemented Interfaces:
java.lang.Comparable<RegularExpression.RegExState>
Enclosing class:
RegularExpression

public static class RegularExpression.RegExState
extends java.lang.Object
implements java.lang.Comparable<RegularExpression.RegExState>

Represents one position in a regular expression


Field Summary
 int id
          Id for toString
static int idcounter
          Counts all RegExStates to have an id for each (for toString)
 java.util.List<RegularExpression.RegExState> successors
          Holds all positions that can follow from here
 java.lang.String token
          Holds the token name at the current position
 
Constructor Summary
RegularExpression.RegExState(java.lang.String token)
          Constructs a RegExChunk with a token
 
Method Summary
 void addSuccessor(RegularExpression.RegExState s)
          Adds one successor
 void addSuccessors(java.util.Collection<RegularExpression.RegExState> s)
          Adds multiple successors
 int compareTo(RegularExpression.RegExState o)
           
 java.lang.String describe()
          Returns a nice description string
 boolean equals(java.lang.Object o)
           
 java.util.List<RegularExpression.RegExState> getSuccessors()
          Returns the successors
 java.lang.String getToken()
          Returns the token
 int hashCode()
           
 void setToken(java.lang.String t)
          Changes the token
 java.lang.String toString()
          Returns the id and the token
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

idcounter

public static int idcounter
Counts all RegExStates to have an id for each (for toString)


id

public final int id
Id for toString


successors

public java.util.List<RegularExpression.RegExState> successors
Holds all positions that can follow from here


token

public java.lang.String token
Holds the token name at the current position

Constructor Detail

RegularExpression.RegExState

public RegularExpression.RegExState(java.lang.String token)
Constructs a RegExChunk with a token

Method Detail

setToken

public void setToken(java.lang.String t)
Changes the token


addSuccessor

public void addSuccessor(RegularExpression.RegExState s)
Adds one successor


addSuccessors

public void addSuccessors(java.util.Collection<RegularExpression.RegExState> s)
Adds multiple successors


getToken

public java.lang.String getToken()
Returns the token


getSuccessors

public java.util.List<RegularExpression.RegExState> getSuccessors()
Returns the successors


toString

public java.lang.String toString()
Returns the id and the token

Overrides:
toString in class java.lang.Object

describe

public java.lang.String describe()
Returns a nice description string


compareTo

public int compareTo(RegularExpression.RegExState o)
Specified by:
compareTo in interface java.lang.Comparable<RegularExpression.RegExState>

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object