context.arch.storage
Class AttributeNameValue

java.lang.Object
  |
  +--context.arch.storage.Attribute
        |
        +--context.arch.storage.AttributeNameValue

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
 
Fields inherited from class context.arch.storage.Attribute
ATTRIBUTE, ATTRIBUTE_TYPE, DEFAULT_TYPE, DOUBLE, FLOAT, INT, LONG, SHORT, STRING, STRUCT
 
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.String getName()
          Returns the name of the stored attribute
 java.lang.String getType()
          Returns the datatype of the attribute
 java.lang.Object getValue()
          Returns the value of the stored attribute
 void setName(java.lang.String name)
          Sets the name of an attribute
 void setType(java.lang.String type)
          Sets the datatype of an 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
getSubAttributes, setSubAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_NAME_VALUE

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

ATTRIBUTE_NAME

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

ATTRIBUTE_VALUE

public static final java.lang.String ATTRIBUTE_VALUE
Tag for an attribute value
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

setName

public void setName(java.lang.String name)
Sets the name of an attribute
Overrides:
setName in class Attribute
Parameters:
name - Name of the attribute to store

setValue

public void setValue(java.lang.Object value)
Sets the value of an attribute
Parameters:
value - Value of the attribute to store

setType

public void setType(java.lang.String type)
Sets the datatype of an attribute
Overrides:
setType in class Attribute
Parameters:
type - Datatype of the attribute to store

getName

public java.lang.String getName()
Returns the name of the stored attribute
Overrides:
getName in class Attribute
Returns:
name of the stored attribute

getValue

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

getType

public java.lang.String getType()
Returns the datatype of the attribute
Overrides:
getType in class Attribute
Returns:
name of the attribute

toString

public java.lang.String toString()
A printable version of this class.
Overrides:
toString in class Attribute
Returns:
String version of this class