JFlex
Class Action

java.lang.Object
  extended by JFlex.Action

public final class Action
extends java.lang.Object

Encapsulates an action in the specification. It stores the Java code as String together with a priority (line number in the specification).


Constructor Summary
Action(java.lang.String content, int priority)
          Creates a new Action object with specified content and line number.
 
Method Summary
 boolean equals(java.lang.Object o)
          Test for equality to another object.
 Action getHigherPriority(Action other)
          Compares the priority value of this Action with the specified action.
 int hashCode()
          Calculate hash value.
 boolean isEquiv(Action a)
          Returns true iff the parameter is an Action with the same content as this one.
 boolean isLookAction()
          Return look ahead flag.
 void setLookAction(boolean b)
          Sets the look ahead flag for this action
 java.lang.String toString()
          Returns the String representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Action

public Action(java.lang.String content,
              int priority)
Creates a new Action object with specified content and line number.

Parameters:
content - java code
priority - line number
Method Detail

getHigherPriority

public Action getHigherPriority(Action other)
Compares the priority value of this Action with the specified action.

Parameters:
other - the other Action to compare this Action with.
Returns:
this Action if it has higher priority - the specified one, if not.

toString

public java.lang.String toString()
Returns the String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
string representation of the action

isEquiv

public boolean isEquiv(Action a)
Returns true iff the parameter is an Action with the same content as this one.

Parameters:
a - the object to compare this Action with
Returns:
true if the action strings are equal

hashCode

public int hashCode()
Calculate hash value.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash value for this Action

equals

public boolean equals(java.lang.Object o)
Test for equality to another object. This action equals another object if the other object is an equivalent action.

Overrides:
equals in class java.lang.Object
Parameters:
o - the other object.
See Also:
isEquiv(Action)

isLookAction

public boolean isLookAction()
Return look ahead flag.

Returns:
true if this actions belongs to a lookahead rule

setLookAction

public void setLookAction(boolean b)
Sets the look ahead flag for this action

Parameters:
b - set to true if this action belongs to a look ahead rule