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

Field Summary
static int DEFAULTDIR
           
static int DEFAULTORDER
           
static int LEFTTORIGHT
           
static int POSTORDER
           
static int PREORDER
           
static int RIGHTTOLEFT
           
 
Fields inherited from class torero.model.Attribute
AUTOINHERIT, AUTOSYNTHESIZE, STANDARD, TRAVERSAL
 
Constructor Summary
protected Traversal(String name, AttributeMap k)
          As mentioned above the constuctor should not be called directly.
 
Method Summary
 int compareTo(Object o)
          Reimplemtented for a well defined sort order of Attribute and Traversal objects.
 int getDirectionSpecifier()
          Returns the Direction Specifier (Ox specific).
 int getOrderSpecifier()
          Returns the Order Specifier (Ox specific).
 int getType()
          Reimplemented for easy distinction to attributes.
 boolean isDisableSpecifier()
          Returns the Disable Specifier state (Ox specific).
 void setDirectionSpecifier(int dir)
          Sets the Direction Specifier (Ox specific).
 void setDisableSpecifier(boolean isset)
          Sets the Disable Specifier.
 void setOrderSpecifier(int order)
          Sets the Order Specifier (Ox specific).
 String toString()
          Returns the String Representation of this Traversal.
 
Methods inherited from class torero.model.Attribute
equals, getName, hashCode, setName, setType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

Traversal

protected Traversal(String name,
                    AttributeMap k)
As mentioned above the constuctor should not be called directly. Use the AttributeMap instead.
Method Detail

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