|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||

java.lang.Objectfr.ocelet.runtime.Hproperty<T>
public class Hproperty<T>
Entity's historic property. A property has the capacity to hold past values. They also are coherent with the transaction mechanism present in entities, meaning that several values can be given as candidates to be set to this property in the future and an AffectOperator will be used to compute the next state of the property at commit time.
| Nested Class Summary | |
|---|---|
class |
Hproperty.HistoryIterator
|
| Field Summary | |
|---|---|
(package private) AffectOperator<T> |
ao
|
(package private) boolean |
containsFuture
|
(package private) java.util.ArrayList<T> |
content
|
(package private) int |
DEFAULT_MAX_ARCS
|
(package private) java.util.ArrayList<T> |
future
|
(package private) int |
historySize
|
(package private) int |
index
|
| Constructor Summary | |
|---|---|
Hproperty(int size)
Produces an instance of a Hproperty with the specified history size. |
|
Hproperty(int size,
int futsz)
Produces an instance of a Hproperty with the specified history size |
|
| Method Summary | |
|---|---|
void |
commitFuture()
Processes the list of candidate values using the AffectOperator assigned to this Hproperty. |
void |
flushFuture()
Clears the list of candidate values. |
T |
get()
|
T |
get(int pastIndex)
Obtain the historic value of this Hproperty pointed to by the argument pastIndex |
java.util.Iterator<T> |
iterator()
Returns an Iterator on the historic values of this Hproperty. |
void |
set(T val)
Changes the actual state of this property with the argument val. |
void |
setAffectOperator(AffectOperator<T> newao)
Set an AffectOperator to process the list of candidate values to be affected to this Hproperty. |
void |
setFuture(T futureval)
Adds a candidate value to the candidate list. |
java.lang.String |
toString()
Overrides the Object.toString() method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
final int DEFAULT_MAX_ARCS
java.util.ArrayList<T> content
java.util.ArrayList<T> future
boolean containsFuture
int index
int historySize
AffectOperator<T> ao
| Constructor Detail |
|---|
public Hproperty(int size)
size - Number of history steps
public Hproperty(int size,
int futsz)
size - Number of history stepsfutsz - Initial number of expected concurrent values (to be processed
by AffectOperators).| Method Detail |
|---|
public void set(T val)
val - The new value to affect to this Hpropertypublic void setFuture(T futureval)
futureval - The candidate valuepublic void setAffectOperator(AffectOperator<T> newao)
newao - An AffectOperatorpublic void commitFuture()
public void flushFuture()
public T get()
public T get(int pastIndex)
pastIndex - Negative or null index to point the historic value to obtain.
If 0 the actual value is returned. If -1 the last step value
is returned, and so on.
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||