All Packages Class Hierarchy This Package Previous Next Index
Class javaParse.State
java.lang.Object
|
+----javaParse.State
- public class State
- extends Object
- implements BinaryPredicate
This class implements a state of a machine.
The painting of a state is done in the Desktop class.
- See Also:
- Desktop
-
id
-
-
isFinal
-
-
label
-
-
stateList
-
-
transitions
-
-
State()
- Construct a new, uninitialized, state.
-
State(int, boolean, int, int)
- Constructs a new State with the specified label, isFinal flag,
and position.
-
State(int, boolean, Point)
- Constructs a new State with the specified label, isFinal flag,
and position.
-
State(State)
- copy constructor
-
compareLabel(State)
- Compares the label of this State with that of the passed State.
-
execute(Object, Object)
- used for sorting the vectors of States with the JGL VectorArray Sorting
-
getTokenizedLabel()
- returns a tokenised version of the Dfa label stored in a Vector of Strings
-
labelToStateList(Desktop)
- turns the label into a list of the corresponding States in the passed nfa
-
paint(Graphics, boolean)
- Paints a state.
-
paintDfaLabel(Graphics, State)
- Paints the label of a State in DFA mode.
-
paintInitial(Graphics, Desktop)
- Paints the triangle that represents the initial state.
-
processKey(int, KeyEvent)
-
handles keyEvents on StateDfalabels for the Desktop
-
setLabel(Vector)
- sets the label to the String corresponding to the Vector of Strings passed
-
stateListToLabel()
- turns a list of States in the corresponding nfa into a String and stores
it as the label
id
public int id
isFinal
public boolean isFinal
transitions
public Vector transitions
stateList
public Vector stateList
label
public String label
State
public State(int id,
boolean isFinal,
Point p)
- Constructs a new State with the specified label, isFinal flag,
and position.
State
public State(int id,
boolean isFinal,
int x,
int y)
- Constructs a new State with the specified label, isFinal flag,
and position.
State
public State()
- Construct a new, uninitialized, state.
Used when reading a machine from a file.
State
public State(State aState)
- copy constructor
execute
public boolean execute(Object a,
Object b)
- used for sorting the vectors of States with the JGL VectorArray Sorting
getTokenizedLabel
public Vector getTokenizedLabel()
- returns a tokenised version of the Dfa label stored in a Vector of Strings
setLabel
public void setLabel(Vector aVector)
- sets the label to the String corresponding to the Vector of Strings passed
labelToStateList
public int labelToStateList(Desktop nfa)
- turns the label into a list of the corresponding States in the passed nfa
- Returns:
- the integer corresponding to any nonexisting states in the nfa.
or -1 if the label is the empty String or -2 if the operation succeeded
stateListToLabel
public void stateListToLabel()
- turns a list of States in the corresponding nfa into a String and stores
it as the label
compareLabel
public boolean compareLabel(State aState)
- Compares the label of this State with that of the passed State.
Precondition: both States already have properly set (and sorted) stateLists.
- Returns:
- true if the two Labels are the same
paint
public void paint(Graphics g,
boolean showDfaLabels)
- Paints a state.
paintDfaLabel
public void paintDfaLabel(Graphics g,
State selectedDfaState)
- Paints the label of a State in DFA mode.
paintInitial
public void paintInitial(Graphics g,
Desktop d)
- Paints the triangle that represents the initial state.
processKey
public boolean processKey(int key,
KeyEvent e)
- handles keyEvents on StateDfalabels for the Desktop
All Packages Class Hierarchy This Package Previous Next Index