context.arch.storage
Class AttributeNameValue

java.lang.Object
  extended bycontext.arch.storage.Attribute
      extended bycontext.arch.storage.AttributeNameValue
All Implemented Interfaces:
java.lang.Comparable

public class AttributeNameValue
extends Attribute

This class is a container for an attribute name, value and type.


Field Summary
static java.lang.String ATTRIBUTE_NAME
          Tag for an attribute name
static java.lang.String ATTRIBUTE_NAME_VALUE
          Tag for an attribute name/value pair
static java.lang.String ATTRIBUTE_VALUE
          Tag for an attribute value
protected  java.lang.Object value
           
 
Fields inherited from class context.arch.storage.Attribute
ATTRIBUTE, ATTRIBUTE_TYPE, attributes, DEFAULT_TYPE, DOUBLE, FLOAT, INT, LONG, name, SHORT, STRING, STRUCT, type
 
Constructor Summary
AttributeNameValue()
          Empty constructor
AttributeNameValue(DataObject attribute)
          Constructor that takes a DataObject as input.
AttributeNameValue(java.lang.String name)
          Constructor that takes only a name
AttributeNameValue(java.lang.String name, java.lang.Object value, java.lang.String type)
          Constructor that takes a name, value and type
 
Method Summary
 java.lang.Object getValue()
          Returns the value of the stored attribute
 void setValue(java.lang.Object value)
          Sets the value of an attribute
 DataObject toDataObject()
          Converts this object to a DataObject.
 java.lang.String toString()
          A printable version of this class.
 
Methods inherited from class context.arch.storage.Attribute
compareTo, getName, getSubAttributes, getType, setName, setSubAttributes, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected java.lang.Object value

ATTRIBUTE_NAME_VALUE

public static final java.lang.String ATTRIBUTE_NAME_VALUE
Tag for an attribute name/value pair

See Also:
Constant Field Values

ATTRIBUTE_NAME

public static final java.lang.String ATTRIBUTE_NAME
Tag for an attribute name

See Also:
Constant Field Values

ATTRIBUTE_VALUE

public static final java.lang.String ATTRIBUTE_VALUE
Tag for an attribute value

See Also:
Constant Field Values
Constructor Detail

AttributeNameValue

public AttributeNameValue()
Empty constructor


AttributeNameValue

public AttributeNameValue(java.lang.String name)
Constructor that takes only a name

Parameters:
name - Name of attribute to store

AttributeNameValue

public AttributeNameValue(java.lang.String name,
                          java.lang.Object value,
                          java.lang.String type)
Constructor that takes a name, value and type

Parameters:
name - Name of attribute to store
value - Value of attribute to store
type - Datatype of attribute to store

AttributeNameValue

public AttributeNameValue(DataObject attribute)
Constructor that takes a DataObject as input. The DataObject must have as its top-level tag

Parameters:
attribute - DataObject containing the attribute info
Method Detail

toDataObject

public DataObject toDataObject()
Converts this object to a DataObject.

Overrides:
toDataObject in class Attribute
Returns:
AttributeNameValue object converted to an DataObject

setValue

public void setValue(java.lang.Object value)
Sets the value of an attribute

Parameters:
value - Value of the attribute to store

getValue

public java.lang.Object getValue()
Returns the value of the stored attribute

Returns:
value of the stored attribute

toString

public java.lang.String toString()
A printable version of this class.

Overrides:
toString in class Attribute
Returns:
String version of this class