torero.model
Class Attribute

java.lang.Object
  |
  +--torero.model.Attribute
All Implemented Interfaces:
Comparable, Serializable
Direct Known Subclasses:
Traversal

public class Attribute
extends Object
implements Comparable, Serializable

Attribute Objects are used in Toreros Attribute Grammar Model to represent the Attributes. They have a name that is unique in an Attribute Grammar. This is uniqueness is maintained by the AttributeMap Class. Obtaining an Attribute within a Grammar should be done via the AttributeMap of the Grammar. Some extensions were added to store Ox specific features (AUTOINHERIT/AUTOSYNTHESIZE).

See Also:
AttributeGrammar, AttributeMap, Serialized Form

Field Summary
static int AUTOINHERIT
           
static int AUTOSYNTHESIZE
           
static int STANDARD
           
static int TRAVERSAL
           
 
Constructor Summary
protected Attribute(String name, AttributeMap k)
          As mentioned above the Attribute constuctor should not be called directly.
 
Method Summary
 int compareTo(Object o)
          Reimplemtented for a well defined sort order of Attribute and Traversal objects.
 boolean equals(Object o)
          Reimplemtented for a uniqueness based on the attribute name.
 String getName()
          Returns the name of the attribute.
 int getType()
          Returns the name of the attribute.
 int hashCode()
           
 void setName(String name)
           
 void setType(int type)
          Set the type which is one of TRAVERSAL, STANDARD, AUTOINHERIT or AUTOSYNTHESIZE (Ox Specific).
 String toString()
          Returns the String Representation of this attribute (the name of the attrib).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TRAVERSAL

public static final int TRAVERSAL

STANDARD

public static final int STANDARD

AUTOINHERIT

public static final int AUTOINHERIT

AUTOSYNTHESIZE

public static final int AUTOSYNTHESIZE
Constructor Detail

Attribute

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

getName

public String getName()
Returns the name of the attribute.
Returns:
returns the name of the attribute

setName

public void setName(String name)
             throws AttributeNameException

getType

public int getType()
Returns the name of the attribute.
Returns:
returns the name of the attribute

setType

public void setType(int type)
Set the type which is one of TRAVERSAL, STANDARD, AUTOINHERIT or AUTOSYNTHESIZE (Ox Specific).
Parameters:
type - is one of TRAVERSAL, STANDARD, AUTOINHERIT or AUTOSYNTHESIZE

compareTo

public int compareTo(Object o)
Reimplemtented for a well defined sort order of Attribute and Traversal objects.
Specified by:
compareTo in interface Comparable

equals

public boolean equals(Object o)
Reimplemtented for a uniqueness based on the attribute name.
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Returns the String Representation of this attribute (the name of the attrib).
Overrides:
toString in class Object
Returns:
returns the String Representation of this attribute (the name of the attrib)