|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmodhelxs.state_management.State
public class State
A State manages the state of a NamedEntity, which is composed of its field of type StateValue.
A State can also be used to initialize the field of type Value of a NamedEntity.
| Field Summary | |
|---|---|
private NamedEntity |
owner_
The NamedEntity which owns the Attributes managed by this State. |
private java.util.HashMap<java.lang.String,java.lang.reflect.Field> |
snap_statevalues_
|
private java.util.HashMap<java.lang.String,java.lang.reflect.Field> |
statevalues_
A name->attribute map of the state values of the owner. |
| Constructor Summary | |
|---|---|
State(NamedEntity e)
Create a State for handling the state values of e. |
|
| Method Summary | |
|---|---|
void |
commit()
Commit the changes to this State. |
private void |
commitValues(java.util.Collection<java.lang.reflect.Field> fields)
|
private static java.util.List<java.lang.reflect.Field> |
getAllFields(java.lang.Class<?> c)
Get all the fields of objects of a class, even inherited ones. |
void |
initFromProperties(java.lang.String... assignments)
Initialize the fields of type Value of the NamedEntity owning this state from its properties. |
void |
revert()
Revert the regular state values to their value after the last commit operation. |
void |
revertSnap()
Revert the snapshot state values to their value after the last commit operation. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private NamedEntity owner_
private java.util.HashMap<java.lang.String,java.lang.reflect.Field> statevalues_
private java.util.HashMap<java.lang.String,java.lang.reflect.Field> snap_statevalues_
| Constructor Detail |
|---|
public State(NamedEntity e)
e.
| Method Detail |
|---|
private static java.util.List<java.lang.reflect.Field> getAllFields(java.lang.Class<?> c)
public void revert()
commit operation.
public void revertSnap()
commit operation.
public void commit()
private void commitValues(java.util.Collection<java.lang.reflect.Field> fields)
public java.lang.String toString()
toString in class java.lang.Objectpublic void initFromProperties(java.lang.String... assignments)
Value of the NamedEntity owning this state from its properties.
By default, each Value is initialized from the property by the same name.
If some values should be initialized from properties with a different name,
the mapping from value name to property name can be given using the assignments
parameter. Each assignment String is in the form "
assignments - a list of strings in the form "assignments will be initialized from properties which have the same
name as the value, if such a property exists.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||