Package org.graffiti.attributes
Class DoubleAttribute
java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.DoubleAttribute
- All Implemented Interfaces:
Attribute,DeepCopy,Displayable
- Direct Known Subclasses:
GradientFillAttribute,ThicknessAttribute
public class DoubleAttribute extends AbstractAttribute
Contains a double
- Version:
- $Revision: 1.6 $
-
Field Summary
Fields Modifier and Type Field Description doublevalueThe value of this attribute -
Constructor Summary
Constructors Constructor Description DoubleAttribute(String id)Constructs a new instance of aDoubleAttribute.DoubleAttribute(String id, double value)Constructs a new instance of aDoubleAttributewith the given value.DoubleAttribute(String id, Double value)Constructs a new instance of aDoubleAttributewith the given value. -
Method Summary
Modifier and Type Method Description Objectcopy()Returns a deep copy of this instance.doublegetDouble()Returns the value of this attribute wrapped in anDoubleobject.ObjectgetValue()Returns the value of the attribute.voidsetDefaultValue()The attribute's value is set so that itsgetValue()method will not returnnull.voidsetDouble(double value)Set 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
-
Field Details
-
value
public double valueThe value of this attribute
-
-
Constructor Details
-
DoubleAttribute
Constructs a new instance of aDoubleAttribute.- Parameters:
id- the id of the attribute
-
DoubleAttribute
Constructs a new instance of aDoubleAttributewith the given value.- Parameters:
id- the id of the attribute.value- the value of the attribute.
-
DoubleAttribute
Constructs a new instance of aDoubleAttributewith 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.- See Also:
Attribute.setDefaultValue()
-
setDouble
public void setDouble(double value)Set the value of this Object.- Parameters:
value- the new value for this object.
-
getDouble
public double getDouble()Returns the value of this attribute wrapped in anDoubleobject.- Returns:
- the value of this attribute wrapped in an
Doubleobject.
-
getValue
Returns the value of the attribute.- Returns:
- the value of the attribute.
-
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()
-