context.arch.storage
Class Condition

java.lang.Object
  |
  +--context.arch.storage.Condition

public class Condition
extends java.lang.Object

This class is a container for a condition attribute, comparison and value.


Field Summary
static java.lang.String COMPARE
          Tag for type of comparison
static java.lang.String CONDITION
          Tag for AttributeCondition
static java.lang.String NAME
          Tag for attribute name to use in comparison
static java.lang.String VALUE
          Tag for value to use for comparison
 
Constructor Summary
Condition()
          Empty constructor
Condition(DataObject data)
          Constructor that creates a Condition object from a DataObject.
Condition(java.lang.String attribute, int compare, java.lang.Object value)
          Constructor that takes an attribute, value and comparison
 
Method Summary
 java.lang.String getAttribute()
          Returns the name of the attribute
 int getCompare()
          Returns the type of comparison
 java.lang.Object getValue()
          Returns the value of the attribute to use for comparison
 void setAttribute(java.lang.String attribute)
          Sets the name of an attribute
 void setCompare(int compare)
          Sets the comparison to make
 void setValue(java.lang.Object value)
          Sets the value of an attribute
 DataObject toDataObject()
          Converts this object to a DataObject
 java.lang.String toString()
          Returns a printable version of the condition object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
Tag for attribute name to use in comparison

COMPARE

public static final java.lang.String COMPARE
Tag for type of comparison

VALUE

public static final java.lang.String VALUE
Tag for value to use for comparison

CONDITION

public static final java.lang.String CONDITION
Tag for AttributeCondition
Constructor Detail

Condition

public Condition()
Empty constructor

Condition

public Condition(java.lang.String attribute,
                 int compare,
                 java.lang.Object value)
Constructor that takes an attribute, value and comparison
Parameters:
name - Name of attribute
compare - Comparison to make
value - Value of attribute to compare to

Condition

public Condition(DataObject data)
Constructor that creates a Condition object from a DataObject. The DataObject must have a tag at the top level.
Parameters:
data - DataObject containing the condition info
Method Detail

toDataObject

public DataObject toDataObject()
Converts this object to a DataObject
Returns:
Condition object converted to an DataObject

setAttribute

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

setValue

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

setCompare

public void setCompare(int compare)
Sets the comparison to make
Parameters:
compare - Comparison to make

getAttribute

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

getValue

public java.lang.Object getValue()
Returns the value of the attribute to use for comparison
Returns:
value of the attribute to use for comparison

getCompare

public int getCompare()
Returns the type of comparison
Returns:
type of comparison

toString

public java.lang.String toString()
Returns a printable version of the condition object
Overrides:
toString in class java.lang.Object
Returns:
printable version of the condition object