torero.model
Class Traversal
java.lang.Object
|
+--torero.model.Attribute
|
+--torero.model.Traversal
- All Implemented Interfaces:
- Comparable, Serializable
- public class Traversal
- extends Attribute
- implements Serializable
Traversal Objects are used in Toreros Attribute Grammar Model to represent ox-like Traversals.
They have a name that is unique in an Attribute Grammar. This is uniqueness is maintained
by the AttributeMap Class. The Traversal Class is inherited from the Attribute Class because
Traversals are Destinations of AttributeAssignments (But cannot be used as sources).
Obtaining an Traversal within a Grammar should be done via the
AttributeMap of the Grammar.
Some extensions were added to store Ox specific features (ORDER and DIRECTION).
- See Also:
AttributeGrammar
,
AttributeMap
,
AttributeAssingnment
, Serialized Form
DEFAULTORDER
public static final int DEFAULTORDER
PREORDER
public static final int PREORDER
POSTORDER
public static final int POSTORDER
DEFAULTDIR
public static final int DEFAULTDIR
LEFTTORIGHT
public static final int LEFTTORIGHT
RIGHTTOLEFT
public static final int RIGHTTOLEFT
Traversal
protected Traversal(String name,
AttributeMap k)
- As mentioned above the constuctor should not be called directly. Use the AttributeMap
instead.
setDirectionSpecifier
public void setDirectionSpecifier(int dir)
- Sets the Direction Specifier (Ox specific).
- Parameters:
dir
- is one of DEFAULTDIR, LEFTTORIGHT or RIGHTTOLEFT.
setOrderSpecifier
public void setOrderSpecifier(int order)
- Sets the Order Specifier (Ox specific).
- Parameters:
order
- is one of DEFAULTORDER, PREORDER, POSTORDER.
setDisableSpecifier
public void setDisableSpecifier(boolean isset)
- Sets the Disable Specifier.
- Parameters:
isset
- is true or false (Ox specific)
getDirectionSpecifier
public int getDirectionSpecifier()
- Returns the Direction Specifier (Ox specific).
- Returns:
- returns DirectionSpecifier state
getOrderSpecifier
public int getOrderSpecifier()
- Returns the Order Specifier (Ox specific).
- Returns:
- returns the OrderSpecifier state
isDisableSpecifier
public boolean isDisableSpecifier()
- Returns the Disable Specifier state (Ox specific).
- Returns:
- returns the DisableSpecifier state
getType
public int getType()
- Reimplemented for easy distinction to attributes.
- Overrides:
getType
in class Attribute
- Returns:
- reimplemented for easy distinction to attributes
compareTo
public int compareTo(Object o)
- Reimplemtented for a well defined sort order of Attribute and Traversal objects.
- Overrides:
compareTo
in class Attribute
toString
public String toString()
- Returns the String Representation of this Traversal.
- Overrides:
toString
in class Attribute
- Returns:
- returns the String Representation of this Traversal