Package org.graffiti.attributes
Class IntegerAttribute
java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.IntegerAttribute
- All Implemented Interfaces:
Attribute,DeepCopy,Displayable
- Direct Known Subclasses:
ChartsColumnAttribute
public class IntegerAttribute extends AbstractAttribute
Contains an integer.
- Version:
- $Revision: 1.5 $
-
Field Summary
-
Constructor Summary
Constructors Constructor Description IntegerAttribute(String id)Constructs a new instance of anIntegerAttribute.IntegerAttribute(String id, int value)Constructs a new instance of anIntegerAttributewith the given value.IntegerAttribute(String id, Integer value)Constructs a new instance of aIntegerAttributewith the given value. -
Method Summary
Modifier and Type Method Description Objectcopy()Returns a deep copy of this instance.intgetInteger()Returns the value of this object.ObjectgetValue()Returns the value of the attribute wrapped in anIntegerobject.voidsetDefaultValue()The attribute's value is set so that itsgetValue()method will not returnnull.voidsetInteger(int value)Sets the value of this object.StringtoXMLString()Returns a well-formed XML string representing the Displayable.Methods inherited from class org.graffiti.attributes.AbstractAttribute
addEdgeAttributeType, addNodeAttributeType, getAttributable, getDescription, getIcon, getId, getName, getParent, getPath, getTypedAttribute, isDeleted, isTypedAttributeFromID, setDeleted, setDescription, setId, setParent, setValue, toString, toString
-
Constructor Details
-
IntegerAttribute
Constructs a new instance of anIntegerAttribute.- Parameters:
id- the id of the attribute
-
IntegerAttribute
Constructs a new instance of anIntegerAttributewith the given value.- Parameters:
id- the id of the attributevalue- the value of the attribute
-
IntegerAttribute
Constructs a new instance of aIntegerAttributewith the given value.- Parameters:
id- the id of the attribute.value- the value of the attribute.
-
-
Method Details
-
setDefaultValue
public void setDefaultValue()Description copied from interface:AttributeThe attribute's value is set so that itsgetValue()method will not returnnull. -
setInteger
public void setInteger(int value)Sets the value of this object. TheListenerManageris informed by the methodsetValue().- Parameters:
value- The new value of this object.
-
getInteger
public int getInteger()Returns the value of this object.- Returns:
- The value of this object.
-
getValue
Returns the value of the attribute wrapped in anIntegerobject.- Returns:
- The value of the attribute wrapped in an
Integerobject.
-
copy
Returns a deep copy of this instance.- Returns:
- a deep copy of this instance.
-
toXMLString
Description copied from interface:DisplayableReturns a well-formed XML string representing the Displayable. The Displayable should be reconstructable via this representation. Therefore it must at least include the type of Displayable (classname) and a representation of its value. PROBABLE FUTURE DESIGN: The Displayables themselves will provide a method to reconstruct their value from the XML representation they provided.- Specified by:
toXMLStringin interfaceDisplayable- Overrides:
toXMLStringin classAbstractAttribute- Returns:
- string holding an XML representation of this Displayable
- See Also:
Displayable.toXMLString()
-