jasi.sim.user.table
Class SimValueConditionTree

java.lang.Object
  extended by jasi.sim.user.table.SimValueConditionTree
All Implemented Interfaces:
java.io.Serializable

public class SimValueConditionTree
extends java.lang.Object
implements java.io.Serializable

A condition table, that allows to retrieve values from a set of conditions based on an if-then-else structure. The conditions are represented by key-value-pairs. The condition table provides the ability to enter values for a default key. This value will be retrieved, if another key will not fit.

See Also:
Serialized Form

Nested Class Summary
static class SimValueConditionTree.Line
          Line in a condition table.
 
Constructor Summary
SimValueConditionTree()
          Table constructor.
SimValueConditionTree(java.lang.String id)
          Table constructor.
 
Method Summary
 void addLine(SimValue values)
          Add a condition line to this table.
 void addLine(SimValue[] values)
          Add a condition line to this table.
 void addLine(SimValue[] keys, SimValue values)
          Add a condition line to this table.
 void addLine(SimValue[] keys, SimValue[] values)
          Add a condition line to this table.
 void addLine(SimValue keys, SimValue values)
          Add a condition line to this table.
 void addLine(SimValue keys, SimValue[] values)
          Add a condition line to this table.
 boolean equals(java.lang.Object o)
          Indicates, whether some other object is "equal to" this one.
 SimValue[] find(SimValue[] keys)
          Find the value for a key.
 java.lang.String getId()
          Get this table's ID.
 java.util.List<SimValueConditionTree.Line> getLines()
          Get the lines of this table.
 int hashCode()
          Returns the hash code value for this assignable object.
 void setId(java.lang.String id)
          Set this table's ID.
 void setLines(java.util.List<SimValueConditionTree.Line> lines)
          Set the lines of this table.
 java.lang.String toString()
          Returns a string representation of this table.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimValueConditionTree

public SimValueConditionTree()
Table constructor.


SimValueConditionTree

public SimValueConditionTree(java.lang.String id)
Table constructor.

Parameters:
id - The table-ID.
Method Detail

getId

public java.lang.String getId()
Get this table's ID.

Returns:
The ID.

setId

public void setId(java.lang.String id)
Set this table's ID.

Parameters:
id - The ID.

setLines

public void setLines(java.util.List<SimValueConditionTree.Line> lines)
Set the lines of this table.

Parameters:
lines - The lines.

getLines

public java.util.List<SimValueConditionTree.Line> getLines()
Get the lines of this table.

Returns:
The lines.

toString

public java.lang.String toString()
Returns a string representation of this table.

Overrides:
toString in class java.lang.Object
Returns:
The string.

hashCode

public int hashCode()
Returns the hash code value for this assignable object. The hash code of a assignable object is defined to be the hashCode of the enclose value of the object, which implements the ConditionType interface. This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two objects t1 and t2, as required by the general contract of Object.hashCode.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code value for this object.

equals

public boolean equals(java.lang.Object o)
Indicates, whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
o - That object which is compared with this object.
Returns:
True, if this object is the same as that object.

addLine

public void addLine(SimValue values)
Add a condition line to this table.

Parameters:
values - The values.

addLine

public void addLine(SimValue[] values)
Add a condition line to this table.

Parameters:
values - The values.

addLine

public void addLine(SimValue keys,
                    SimValue values)
Add a condition line to this table.

Parameters:
keys - The keys.
values - The values.

addLine

public void addLine(SimValue[] keys,
                    SimValue values)
Add a condition line to this table.

Parameters:
keys - The keys.
values - The values.

addLine

public void addLine(SimValue keys,
                    SimValue[] values)
Add a condition line to this table.

Parameters:
keys - The keys.
values - The values.

addLine

public void addLine(SimValue[] keys,
                    SimValue[] values)
Add a condition line to this table.

Parameters:
keys - The keys.
values - The values.

find

public SimValue[] find(SimValue[] keys)
Find the value for a key.

Parameters:
keys - The key.
Returns:
The value or null.