context.arch.storage
Class Attribute

java.lang.Object
  |
  +--context.arch.storage.Attribute
Direct Known Subclasses:
AttributeFunction, AttributeNameValue

public class Attribute
extends java.lang.Object

This class is a container for an attribute name, subAttributes (used for structures - STRUCT) and type.


Field Summary
static java.lang.String ATTRIBUTE
          Tag for an attribute
static java.lang.String ATTRIBUTE_TYPE
          Tag for an attribute data type
static java.lang.String DEFAULT_TYPE
          Tag for default attribute type
static java.lang.String DOUBLE
          Tag for DOUBLE datatype
static java.lang.String FLOAT
          Tag for FLOAT datatype
static java.lang.String INT
          Tag for INT datatype
static java.lang.String LONG
          Tag for LONG datatype
static java.lang.String SHORT
          Tag for SHORT datatype
static java.lang.String STRING
          Tag for STRING datatype
static java.lang.String STRUCT
          Tag for structure type
 
Constructor Summary
Attribute()
          Empty constructor
Attribute(DataObject attribute)
          Constructor that takes a DataObject as input.
Attribute(java.lang.String name)
          Constructor that takes only a name
Attribute(java.lang.String name, Attributes attributes, 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
 Attributes getSubAttributes()
          Returns the subAttributes of the stored attribute
 java.lang.String getType()
          Returns the datatype of the attribute
 void setName(java.lang.String name)
          Sets the name of an attribute
 void setSubAttributes(Attributes attributes)
          Sets the subAttributes of this attribute
 void setType(java.lang.String type)
          Sets the datatype 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_TYPE

public static final java.lang.String ATTRIBUTE_TYPE
Tag for an attribute data type

ATTRIBUTE

public static final java.lang.String ATTRIBUTE
Tag for an attribute

DEFAULT_TYPE

public static final java.lang.String DEFAULT_TYPE
Tag for default attribute type

STRUCT

public static final java.lang.String STRUCT
Tag for structure type

LONG

public static final java.lang.String LONG
Tag for LONG datatype

DOUBLE

public static final java.lang.String DOUBLE
Tag for DOUBLE datatype

FLOAT

public static final java.lang.String FLOAT
Tag for FLOAT datatype

SHORT

public static final java.lang.String SHORT
Tag for SHORT datatype

INT

public static final java.lang.String INT
Tag for INT datatype

STRING

public static final java.lang.String STRING
Tag for STRING datatype
Constructor Detail

Attribute

public Attribute()
Empty constructor

Attribute

public Attribute(java.lang.String name)
Constructor that takes only a name
Parameters:
name - Name of attribute to store

Attribute

public Attribute(java.lang.String name,
                 Attributes attributes,
                 java.lang.String type)
Constructor that takes a name, value, and type
Parameters:
name - Name of attribute to store
attributes - subAttributes of this attribute
type - Datatype of attribute to store

Attribute

public Attribute(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.
Returns:
Attribute object converted to an DataObject

setName

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

setSubAttributes

public void setSubAttributes(Attributes attributes)
Sets the subAttributes of this attribute
Parameters:
attributes - subAttributes of the attribute to store

setType

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

getName

public java.lang.String getName()
Returns the name of the stored attribute
Returns:
name of the stored attribute

getSubAttributes

public Attributes getSubAttributes()
Returns the subAttributes of the stored attribute
Returns:
subAttributes of the stored attribute

getType

public java.lang.String getType()
Returns the datatype of the attribute
Returns:
name of the attribute

toString

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