context.arch.storage
Class AttributeFunction

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

public class AttributeFunction
extends Attribute

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


Field Summary
static java.lang.String ATTRIBUTE
          Tag for an attribute
static java.lang.String ATTRIBUTE_FUNCTION
          Tag for an attribute function object
static java.lang.String FUNCTION
          Tag for an attribute function
static java.lang.String FUNCTION_AVG
          Tag for AVG function
static java.lang.String FUNCTION_COUNT
          Tag for COUNT function
static java.lang.String FUNCTION_MAX
          Tag for MAX function
static java.lang.String FUNCTION_MIN
          Tag for MIN function
static java.lang.String FUNCTION_NONE
          Tag for default function - none
static java.lang.String FUNCTION_SUM
          Tag for SUM function
 
Fields inherited from class context.arch.storage.Attribute
ATTRIBUTE, ATTRIBUTE_TYPE, DEFAULT_TYPE, DOUBLE, FLOAT, INT, LONG, SHORT, STRING, STRUCT
 
Constructor Summary
AttributeFunction()
          Empty constructor
AttributeFunction(DataObject af)
          Constructor that takes a DataObject as input.
AttributeFunction(java.lang.String name)
          Constructor that takes only a name
AttributeFunction(java.lang.String name, AttributeFunctions afs, java.lang.String type)
          Constructor that takes a name, value, and type
AttributeFunction(java.lang.String name, AttributeFunctions afs, java.lang.String type, java.lang.String function)
          Constructor that takes a name, value, and type
AttributeFunction(java.lang.String name, java.lang.String function)
          Constructor that takes only a name and a function
 
Method Summary
 java.lang.String getFunction()
          Returns the function of an attribute
 java.lang.String getName()
          Returns the name of the stored attribute
 AttributeFunctions getSubAttributeFunctions()
          Returns the subAttributes of the stored attribute
 java.lang.String getType()
          Returns the datatype of the attribute
 void setFunction(java.lang.String function)
          Sets the function of an attribute
 void setName(java.lang.String name)
          Sets the name of an attribute
 void setSubAttributes(AttributeFunctions afs)
          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 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_FUNCTION

public static final java.lang.String ATTRIBUTE_FUNCTION
Tag for an attribute function object

FUNCTION

public static final java.lang.String FUNCTION
Tag for an attribute function

ATTRIBUTE

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

FUNCTION_NONE

public static final java.lang.String FUNCTION_NONE
Tag for default function - none

FUNCTION_MAX

public static final java.lang.String FUNCTION_MAX
Tag for MAX function

FUNCTION_MIN

public static final java.lang.String FUNCTION_MIN
Tag for MIN function

FUNCTION_COUNT

public static final java.lang.String FUNCTION_COUNT
Tag for COUNT function

FUNCTION_AVG

public static final java.lang.String FUNCTION_AVG
Tag for AVG function

FUNCTION_SUM

public static final java.lang.String FUNCTION_SUM
Tag for SUM function
Constructor Detail

AttributeFunction

public AttributeFunction()
Empty constructor

AttributeFunction

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

AttributeFunction

public AttributeFunction(java.lang.String name,
                         java.lang.String function)
Constructor that takes only a name and a function
Parameters:
name - Name of attribute to store
function - Function to execute on attribute

AttributeFunction

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

AttributeFunction

public AttributeFunction(java.lang.String name,
                         AttributeFunctions afs,
                         java.lang.String type,
                         java.lang.String function)
Constructor that takes a name, value, and type
Parameters:
name - Name of attribute to store
afs - subAttributes of this attribute
type - Datatype of attribute to store
function - Function to execute on attribute

AttributeFunction

public AttributeFunction(DataObject af)
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:
Attribute 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

setSubAttributes

public void setSubAttributes(AttributeFunctions afs)
Sets the subAttributes of this attribute
Parameters:
afs - subAttributes 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

setFunction

public void setFunction(java.lang.String function)
Sets the function of an attribute
Parameters:
function - Function to act on the attribute

getName

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

getSubAttributeFunctions

public AttributeFunctions getSubAttributeFunctions()
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
Overrides:
getType in class Attribute
Returns:
name of the attribute

getFunction

public java.lang.String getFunction()
Returns the function of an attribute
Returns:
function to act on 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