context.arch.storage
Class AttributeFunction

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

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
protected  AttributeFunctions afs
           
static java.lang.String ATTRIBUTE
          Tag for an attribute
static java.lang.String ATTRIBUTE_FUNCTION
          Tag for an attribute function object
protected  java.lang.String function
           
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_TYPE, attributes, DEFAULT_TYPE, DOUBLE, FLOAT, INT, LONG, name, SHORT, STRING, STRUCT, type
 
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
 AttributeFunctions getSubAttributeFunctions()
          Returns the subAttributes of the stored attribute
 void setFunction(java.lang.String function)
          Sets the function of an attribute
 void setSubAttributes(AttributeFunctions afs)
          Sets the subAttributes of this 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

afs

protected AttributeFunctions afs

function

protected java.lang.String function

ATTRIBUTE_FUNCTION

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

See Also:
Constant Field Values

FUNCTION

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

See Also:
Constant Field Values

ATTRIBUTE

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

See Also:
Constant Field Values

FUNCTION_NONE

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

See Also:
Constant Field Values

FUNCTION_MAX

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

See Also:
Constant Field Values

FUNCTION_MIN

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

See Also:
Constant Field Values

FUNCTION_COUNT

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

See Also:
Constant Field Values

FUNCTION_AVG

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

See Also:
Constant Field Values

FUNCTION_SUM

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

See Also:
Constant Field Values
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

Method Detail

toDataObject

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

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

setSubAttributes

public void setSubAttributes(AttributeFunctions afs)
Sets the subAttributes of this attribute

Parameters:
afs - subAttributes 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

getSubAttributeFunctions

public AttributeFunctions getSubAttributeFunctions()
Returns the subAttributes of the stored attribute

Returns:
subAttributes of the stored 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