Class LongAttribute

java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.LongAttribute
All Implemented Interfaces:
Attribute, DeepCopy, Displayable

public class LongAttribute
extends AbstractAttribute
Contains a long
Version:
$Revision: 1.5 $
  • Constructor Details

    • LongAttribute

      public LongAttribute​(String id)
      Constructs a new instance of a LongAttribute.
      Parameters:
      id - the id of the attribute
    • LongAttribute

      public LongAttribute​(String id, long value)
      Constructs a new instance of a LongAttribute with the given value.
      Parameters:
      id - the id of the attribute.
      value - the value of the attribute.
    • LongAttribute

      public LongAttribute​(String id, Long value)
      Constructs a new instance of a LongAttribute 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 its getValue() method will not return null.
      See Also:
      Attribute.setDefaultValue()
    • setLong

      public void setLong​(long value)
      Set the value of this Object.
      Parameters:
      value - the new value for this object.
    • getLong

      public long getLong()
      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 Long object.
      Returns:
      the value of the attribute wrapped in an Long 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
      Overrides:
      toXMLString in class AbstractAttribute
      Returns:
      string holding an XML representation of this Displayable
      See Also:
      Displayable.toXMLString()