jasi.sim.user.util
Class State

java.lang.Object
  extended by jasi.sim.user.util.State

public class State
extends java.lang.Object

This class allows to access the state of a simulation elements and events. The state of an element or event can be set by an archive reader or got by an archive writer.


Constructor Summary
State(java.lang.Object object)
          Constructor of StringState.
 
Method Summary
 java.util.Map<java.beans.PropertyDescriptor,java.lang.Object> get()
          Get the state of the enclosed object.
 void put(java.lang.String name, java.lang.Object value)
          Set the value of an attribute/property of the enclosed object.
 void put(java.lang.String name, java.lang.Object[] values)
          Set the value of an array attribute/indexed property of the enclosed object.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

State

public State(java.lang.Object object)
      throws StateException
Constructor of StringState.

Parameters:
object - The enclosed object, which state is accessed.
Throws:
StateException - An error when creating a state object.
Method Detail

get

public final java.util.Map<java.beans.PropertyDescriptor,java.lang.Object> get()
                                                                        throws StateException
Get the state of the enclosed object. The state is represented by a map, where as key the property (PropertyDescriptor) and as value the value (String or String[] entries) of the enclosed object's properties/attributes are given.

Returns:
The state map of the properties.
Throws:
StateException - An error when creating a state map.

put

public final void put(java.lang.String name,
                      java.lang.Object value)
               throws StateException
Set the value of an attribute/property of the enclosed object.

Parameters:
name - The property's name.
value - The property's value.
Throws:
StateException - An error, when a value is put into state.

put

public final void put(java.lang.String name,
                      java.lang.Object[] values)
               throws StateException
Set the value of an array attribute/indexed property of the enclosed object.

Parameters:
name - The array-attribute's name.
values - The array-attribute's values.
Throws:
StateException - An error, when value list is put into state.

toString

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

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