Package org.graffiti.attributes
Class FloatAttribute
java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.FloatAttribute
- All Implemented Interfaces:
Attribute
,DeepCopy
,Displayable
public class FloatAttribute extends AbstractAttribute
Contains a float
- Version:
- $Revision: 1.5 $
-
Field Summary
-
Constructor Summary
Constructors Constructor Description FloatAttribute(String id)
Constructs a new instance of aFloatAttribute
.FloatAttribute(String id, float value)
Constructs a new instance of aFloatAttribute
with the given value.FloatAttribute(String id, Float value)
Constructs a new instance of aFloatAttribute
with the given value. -
Method Summary
Modifier and Type Method Description Object
copy()
Returns a deep copy of this instance.float
getFloat()
Returns the value of this object.Object
getValue()
Returns the value of the attribute wrapped in anFloat
object.void
setDefaultValue()
The attribute's value is set so that itsgetValue()
method will not returnnull
.void
setFloat(float value)
Set the value of this Object.String
toXMLString()
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
-
FloatAttribute
Constructs a new instance of aFloatAttribute
.- Parameters:
id
- the id of the attribute.
-
FloatAttribute
Constructs a new instance of aFloatAttribute
with the given value.- Parameters:
id
- the id of the attribute.value
- the value of the attribute.
-
FloatAttribute
Constructs a new instance of aFloatAttribute
with 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:Attribute
The attribute's value is set so that itsgetValue()
method will not returnnull
.- See Also:
Attribute.setDefaultValue()
-
setFloat
public void setFloat(float value)Set the value of this Object.- Parameters:
value
- the new value for this object.
-
getFloat
public float getFloat()Returns the value of this object.- Returns:
- the value of this object.
-
getValue
Returns the value of the attribute wrapped in anFloat
object.- Returns:
- the value of the attribute wrapped in an
Float
object.
-
copy
Returns a deep copy of this instance.- Returns:
- a deep copy of this instance.
-
toXMLString
Description copied from interface:Displayable
Returns 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:
toXMLString
in interfaceDisplayable
- Overrides:
toXMLString
in classAbstractAttribute
- Returns:
- string holding an XML representation of this Displayable
- See Also:
Displayable.toXMLString()
-