Package org.graffiti.attributes
Class BooleanAttribute
java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.BooleanAttribute
- All Implemented Interfaces:
Attribute
,DeepCopy
,Displayable
public class BooleanAttribute extends AbstractAttribute
Contains a boolean value.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BooleanAttribute()
BooleanAttribute(String id)
Constructs a new instance of aBooleanAttribute
.BooleanAttribute(String id, boolean value)
Constructs a new instance of aBooleanAttribute
with the given value.BooleanAttribute(String id, Boolean value)
Constructs a new instance of aBooleanAttribute
with the given value.BooleanAttribute(String id, String val)
-
Method Summary
Modifier and Type Method Description Object
copy()
Returns a deep copy of this instance.boolean
getBoolean()
Returns the value of this object.Object
getValue()
Returns the value of the attribute wrapped in anBoolean
object.static boolean
getValueFromString(String val)
void
setBoolean(boolean value)
Sets the value of this object.void
setDefaultValue()
The attribute's value is set so that itsgetValue()
method will not returnnull
.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
-
BooleanAttribute
Constructs a new instance of aBooleanAttribute
.- Parameters:
id
- the id of the attribute.
-
BooleanAttribute
Constructs a new instance of aBooleanAttribute
with the given value.- Parameters:
id
- the id of the attribute.value
- the value of the attribute.
-
BooleanAttribute
Constructs a new instance of aBooleanAttribute
with the given value.- Parameters:
id
- the id of the attribute.value
- the value of the attribute.
-
BooleanAttribute
public BooleanAttribute() -
BooleanAttribute
-
-
Method Details
-
getValueFromString
-
setBoolean
public void setBoolean(boolean value)Sets the value of this object.- Parameters:
value
- the new value of this object.
-
getBoolean
public boolean getBoolean()Returns the value of this object.- Returns:
- the value of this object.
-
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()
-
getValue
Returns the value of the attribute wrapped in anBoolean
object.- Returns:
- the value of the attribute wrapped in an
Boolean
object.
-
copy
Returns a deep copy of this instance. Parent won't be set because the context may be different.- 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()
-