context.arch.storage
Class AttributeFunctions

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--context.arch.storage.AttributeFunctions

public class AttributeFunctions
extends java.util.Vector

This class is a container for a group of related attributes and functions. AttributeFunctions can be added, removed, and found in the container.

See Also:
Serialized Form

Field Summary
static java.lang.String ALL
          Tag to indicate all attributes are to be used
static java.lang.String ATTRIBUTE_FUNCTIONS
          Tag for attributes
static char SEPARATOR
          Connector for nested attributes
static java.lang.String SEPARATOR_STRING
          Connector for nested attributes - String
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AttributeFunctions()
          Empty constructor
AttributeFunctions(DataObject data)
          Constructor that takes a DataObject as a parameter.
 
Method Summary
 void addAttributeFunction(AttributeFunction att)
          Adds the given AttributeFunction object to the container.
 void addAttributeFunction(java.lang.String name)
          Adds the given attribute name.
 void addAttributeFunction(java.lang.String name, AttributeFunctions attributes)
          Adds the given attribute name and value to the container.
 void addAttributeFunction(java.lang.String name, AttributeFunctions attributes, java.lang.String type)
          Adds the given attribute name, subAttributes and type to the container
 void addAttributeFunction(java.lang.String name, AttributeFunctions attributes, java.lang.String type, java.lang.String function)
          Adds the given attribute name, subAttributes and type to the container
 void addAttributeFunction(java.lang.String name, java.lang.String type)
          Adds the given attribute name and data type
 void addAttributeFunction(java.lang.String name, java.lang.String type, java.lang.String function)
          Adds the given attribute name and data type and function
 void addAttributeFunctions(AttributeFunctions atts)
          Adds the given AttributeFunctions object to the container.
 AttributeFunction getAttributeFunction(java.lang.String name)
          This method returns the AttributeFunction with the given name from this list of AttributeFunctions.
 AttributeFunction getAttributeFunction(java.lang.String name, java.lang.String prefix)
          This method returns the AttributeFunction with the given name from this list of AttributeFunctions.
 AttributeFunction getAttributeFunctionAt(int index)
          Returns the AttributeFunction object at the given index
 AttributeFunctions getSubset(AttributeFunctions atts)
          This method takes a DataObject containing the list of attributes (names) wanted and it filters all the rest out from this AttributeFunctions object.
 boolean hasAttributeFunction(AttributeFunction att)
          Determines whether the given AttributeFunction object is in the container
 boolean hasAttributeFunction(java.lang.String name, AttributeFunctions attributes)
          Determines whether the given attribute name and subAttributes are in the container, using the default datatype.
 boolean hasAttributeFunction(java.lang.String name, AttributeFunctions attributes, java.lang.String type)
          Determines whether the given attribute name, subAttributes and type are in the container,
 int indexOfAttributeFunction(AttributeFunction att)
          Returns the index at which the AttributeFunction object occurs
 int indexOfAttributeFunction(java.lang.String name, AttributeFunctions attributes)
          Returns the index at which the given attribute name and subAttributes occurs, using the default datatype
 int indexOfAttributeFunction(java.lang.String name, AttributeFunctions attributes, java.lang.String type)
          Returns the index at which the given attribute name, subAttributes and type occurs.
 int numAttributeFunctions()
          Returns the number of AttributeFunctions in the container return the number of AttributeFunctions in the container
 java.lang.String toAString()
          A printable version of this class.
 DataObject toDataObject()
          Converts to a DataObject.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

public static final char SEPARATOR
Connector for nested attributes

SEPARATOR_STRING

public static final java.lang.String SEPARATOR_STRING
Connector for nested attributes - String

ATTRIBUTE_FUNCTIONS

public static final java.lang.String ATTRIBUTE_FUNCTIONS
Tag for attributes

ALL

public static final java.lang.String ALL
Tag to indicate all attributes are to be used
Constructor Detail

AttributeFunctions

public AttributeFunctions()
Empty constructor

AttributeFunctions

public AttributeFunctions(DataObject data)
Constructor that takes a DataObject as a parameter. The DataObject is expected to contain an tag. The constructor stores the encoded data in an AttributeFunctions object.
Parameters:
data - DataObject that contains the attribute name (and possibly type and function) info
Method Detail

toDataObject

public DataObject toDataObject()
Converts to a DataObject.
Returns:
AttributeFunctions object converted to an DataObject

addAttributeFunction

public void addAttributeFunction(AttributeFunction att)
Adds the given AttributeFunction object to the container.
Parameters:
att - AttributeFunction to add

addAttributeFunction

public void addAttributeFunction(java.lang.String name)
Adds the given attribute name.
Parameters:
name - Name of the attribute to add

addAttributeFunction

public void addAttributeFunction(java.lang.String name,
                                 java.lang.String type)
Adds the given attribute name and data type
Parameters:
name - Name of the attribute to add
type - Datatype of the attribute to add

addAttributeFunction

public void addAttributeFunction(java.lang.String name,
                                 java.lang.String type,
                                 java.lang.String function)
Adds the given attribute name and data type and function
Parameters:
name - Name of the attribute to add
type - Datatype of the attribute to add
function - Function of the attribute to add

addAttributeFunction

public void addAttributeFunction(java.lang.String name,
                                 AttributeFunctions attributes)
Adds the given attribute name and value to the container. It uses a default datatype.
Parameters:
name - Name of the attribute to add
attributes - SubAttributes of the attribute to add

addAttributeFunction

public void addAttributeFunction(java.lang.String name,
                                 AttributeFunctions attributes,
                                 java.lang.String type)
Adds the given attribute name, subAttributes and type to the container
Parameters:
name - Name of the attribute to add
attributes - SubAttributes of the attribute to add
type - Datatype of the attribute to add

addAttributeFunction

public void addAttributeFunction(java.lang.String name,
                                 AttributeFunctions attributes,
                                 java.lang.String type,
                                 java.lang.String function)
Adds the given attribute name, subAttributes and type to the container
Parameters:
name - Name of the attribute to add
attributes - SubAttributes of the attribute to add
type - Datatype of the attribute to add
function - Function of the attribute to add

addAttributeFunctions

public void addAttributeFunctions(AttributeFunctions atts)
Adds the given AttributeFunctions object to the container.
Parameters:
atts - Attributes to add

getAttributeFunctionAt

public AttributeFunction getAttributeFunctionAt(int index)
Returns the AttributeFunction object at the given index
Parameters:
index - Index into the container
Returns:
AttributeFunction at the specified index

hasAttributeFunction

public boolean hasAttributeFunction(AttributeFunction att)
Determines whether the given AttributeFunction object is in the container
Parameters:
att - AttributeFunction to check
Returns:
whether AttributeFunction is in the container

hasAttributeFunction

public boolean hasAttributeFunction(java.lang.String name,
                                    AttributeFunctions attributes)
Determines whether the given attribute name and subAttributes are in the container, using the default datatype.
Parameters:
name - Name of the attribute to check
attributes - SubAttributes of the attribute to check
Returns:
whether the given attribute name and subAttributes are in the container

hasAttributeFunction

public boolean hasAttributeFunction(java.lang.String name,
                                    AttributeFunctions attributes,
                                    java.lang.String type)
Determines whether the given attribute name, subAttributes and type are in the container,
Parameters:
name - Name of the attribute to check
attributes - SubAttributes of the attribute to check
type - Datatype of the attribute to check
Returns:
whether the given attribute name, subAttributes and type are in the container

indexOfAttributeFunction

public int indexOfAttributeFunction(AttributeFunction att)
Returns the index at which the AttributeFunction object occurs
Parameters:
att - AttributeFunction to look for
Returns:
index of the specified AttributeFunction

indexOfAttributeFunction

public int indexOfAttributeFunction(java.lang.String name,
                                    AttributeFunctions attributes)
Returns the index at which the given attribute name and subAttributes occurs, using the default datatype
Parameters:
name - Name of the attribute to look for
attributes - SubAttributes of the attribute to look for
Returns:
index of the specified AttributeFunction

indexOfAttributeFunction

public int indexOfAttributeFunction(java.lang.String name,
                                    AttributeFunctions attributes,
                                    java.lang.String type)
Returns the index at which the given attribute name, subAttributes and type occurs.
Parameters:
name - Name of the attribute to look for
attributes - SubAttributes of the attribute to look for
type - Datatype of the attribute to look for
Returns:
index of the specified Attribute

numAttributeFunctions

public int numAttributeFunctions()
Returns the number of AttributeFunctions in the container return the number of AttributeFunctions in the container

getAttributeFunction

public AttributeFunction getAttributeFunction(java.lang.String name)
This method returns the AttributeFunction with the given name from this list of AttributeFunctions.
Parameters:
name - of the AttributeFunction to return
Returns:
AttributeFunction with the given name

getAttributeFunction

public AttributeFunction getAttributeFunction(java.lang.String name,
                                              java.lang.String prefix)
This method returns the AttributeFunction with the given name from this list of AttributeFunctions.
Parameters:
name - of the AttributeFunction to return
prefix - Structure name to use
Returns:
AttributeFunction with the given name

getSubset

public AttributeFunctions getSubset(AttributeFunctions atts)
This method takes a DataObject containing the list of attributes (names) wanted and it filters all the rest out from this AttributeFunctions object.
Parameters:
atts - AttributeFunctions object containing the attributes to return
Returns:
filtered Attributes object

toAString

public java.lang.String toAString()
A printable version of this class.
Returns:
String version of this class