public class StateElement
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
attributeName
The name of the attribute that the value is stored by this state element.
|
protected java.lang.String |
id
This field is used by the SQL module while storing/restoring model into/from database.
|
protected long |
timestamp
Timestamp in milliseconds indicating when the attribute value was assigned.
|
protected Value |
value
The value of the attribute.
|
| Constructor and Description |
|---|
StateElement()
default constructor.
|
StateElement(java.lang.String attributeName,
Value value)
The constructor creates StateElement object, and it sets the
timestamp
to the current system time. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAttributeName()
The method that retrievs the attribute name that value is retained in this state element
|
long |
getTimestamp()
A method returns the timestamp of the state element.
|
Value |
getValue()
The method returns the value of the attribute
|
void |
setAttributeName(java.lang.String attributeName)
The method sets the attribute name for this state element.
|
void |
setCurrentTimestamp()
The method sets the timestam of the state element to the current system time.
|
void |
setTimestamp(long timestamp)
The method allow to set the timestamp for the state element.
|
void |
setValue(Value value)
The method that sets the value for the attribute in this state element.
|
protected java.lang.String id
protected java.lang.String attributeName
protected Value value
protected long timestamp
Attribute object.public StateElement()
timestampto the current system time
and leaves all the other fields to be nullpublic StateElement(java.lang.String attributeName,
Value value)
timestamp
to the current system time.attributeName - the attribute name that value should be tored in the state elementvalue - the value of the attribute that should be assigned to itpublic java.lang.String getAttributeName()
public void setAttributeName(java.lang.String attributeName)
attributeName - a name to be setpublic Value getValue()
public void setValue(Value value)
SetValue to a simple attribute and it will pass.
The exception will be thrown only when you try to assign this state to the model.value - public void setCurrentTimestamp()
System.currentTimeMillis() method.public long getTimestamp()
public void setTimestamp(long timestamp)
setCurrentTimestamp()
instead.timestamp - a timestamp to set