org.graffiti.attributes
Class ShortAttribute

java.lang.Object
  extended by org.graffiti.attributes.AbstractAttribute
      extended by org.graffiti.attributes.ShortAttribute
All Implemented Interfaces:
Attribute, DeepCopy, Displayable<Object>

public class ShortAttribute
extends AbstractAttribute

Contains a short

Version:
$Revision: 5767 $

Field Summary
 
Fields inherited from interface org.graffiti.attributes.Attribute
SEPARATOR
 
Constructor Summary
ShortAttribute(String id)
          Constructs a new instance of a ShortAttribute.
ShortAttribute(String id, short value)
          Constructs a new instance of a ShortAttribute with the given value.
ShortAttribute(String id, Short value)
          Constructs a new instance of a ShortAttribute with the given value.
 
Method Summary
 Object copy()
          Returns a deep copy of this instance.
 short getShort()
          Returns the value of this object.
 Object getValue()
          Returns the value of the attribute wrapped in an Short object.
 void setDefaultValue()
          The attribute's value is set so that its getValue() method will not return null.
 void setShort(short 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
getAttributable, getDescription, getId, getName, getParent, getPath, setDescription, setParent, setValue, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShortAttribute

public ShortAttribute(String id)
Constructs a new instance of a ShortAttribute.

Parameters:
id - the id of the attribute

ShortAttribute

public ShortAttribute(String id,
                      short value)
Constructs a new instance of a ShortAttribute with the given value.

Parameters:
id - the id of the attribute.
value - the value of the attribute.

ShortAttribute

public ShortAttribute(String id,
                      Short value)
Constructs a new instance of a ShortAttribute with the given value.

Parameters:
id - the id of the attribute.
value - the value of the attribute.
Method Detail

setDefaultValue

public void setDefaultValue()
Description copied from interface: Attribute
The attribute's value is set so that its getValue() method will not return null.

See Also:
Attribute.setDefaultValue()

setShort

public void setShort(short value)
Set the value of this Object.

Parameters:
value - the new value for this object.

getShort

public short getShort()
Returns the value of this object.

Returns:
the value of this object.

getValue

public Object getValue()
Returns the value of the attribute wrapped in an Short object.

Returns:
the value of the attribute wrapped in an Short object.

copy

public Object copy()
Returns a deep copy of this instance.

Returns:
a deep copy of this instance.

toXMLString

public String 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 interface Displayable<Object>
Overrides:
toXMLString in class AbstractAttribute
Returns:
string holding an XML representation of this Displayable
See Also:
Displayable.toXMLString()


Generated at 2012-05-30 11:00:14 PM CEST