antsnest.datastructure
Class DefaultAntAttribute

java.lang.Object
  extended by antsnest.datastructure.DefaultAntAttribute
All Implemented Interfaces:
AntAttribute, ChangeListener, Serializable

public class DefaultAntAttribute
extends Object
implements AntAttribute, ChangeListener

Implementation of AntAttribute

Author:
Chris Clohosy
See Also:
AntAttribute, ChangeListener, Serialized Form

Constructor Summary
DefaultAntAttribute()
          Constructs a new attribute
DefaultAntAttribute(AttributeDefinition definition)
          Constructs a new attribute from a definition
 
Method Summary
 AntAttribute cloneAttribute()
          Clones this attribute
 boolean equals(Object obj)
          Tests whether two attributes are equal
 String getName()
          Get the name of this attribute
 String getValue()
          Get the value of this attribute
 boolean isRequired()
          Whether this attribute is currently required
 void nodeChanged(ChangeEvent event)
          Called when a node is changed
 void setConditionList(ConditionList list)
          Sets the condition list used by this attribute
 void setName(String name)
          Set the name of this attribute
 void setRequired(boolean required)
          Set whether this attribute is required
 void setValue(String value)
          Set the value of this attribute
 String toString()
          Converts this attribute into a string representation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultAntAttribute

public DefaultAntAttribute()
Constructs a new attribute


DefaultAntAttribute

public DefaultAntAttribute(AttributeDefinition definition)
Constructs a new attribute from a definition

Parameters:
definition - a definition of an attribute
Method Detail

getName

public String getName()
Get the name of this attribute

Specified by:
getName in interface AntAttribute
Returns:
a String, the name

setName

public void setName(String name)
Set the name of this attribute

Specified by:
setName in interface AntAttribute
Parameters:
name - the new name

getValue

public String getValue()
Get the value of this attribute

Specified by:
getValue in interface AntAttribute
Returns:
a String, the value

setValue

public void setValue(String value)
Set the value of this attribute

Specified by:
setValue in interface AntAttribute
Parameters:
value - the new value

isRequired

public boolean isRequired()
Whether this attribute is currently required

Specified by:
isRequired in interface AntAttribute
Returns:
a boolean, whether it's required

setRequired

public void setRequired(boolean required)
Set whether this attribute is required

Specified by:
setRequired in interface AntAttribute
Parameters:
required - whether it's required

equals

public boolean equals(Object obj)
Tests whether two attributes are equal

Overrides:
equals in class Object
Parameters:
obj - the object to compare against
Returns:
a boolean, whether they are equal

nodeChanged

public void nodeChanged(ChangeEvent event)
Called when a node is changed

Specified by:
nodeChanged in interface ChangeListener
Parameters:
event - the event that encapsulates information about the change

toString

public String toString()
Converts this attribute into a string representation

Overrides:
toString in class Object
Returns:
a String, the string representation

setConditionList

public void setConditionList(ConditionList list)
Sets the condition list used by this attribute

Parameters:
list - the condition list

cloneAttribute

public AntAttribute cloneAttribute()
Clones this attribute

Specified by:
cloneAttribute in interface AntAttribute
Returns:
an AntAttribute, the clone