T
- a class being stored at different time stamps.public class TimeStamp<T> extends Object implements Stateful
It will (it has to) store the same object at different levels as users of the timestamp may ask for the level at which the timestamp was recently updated.
Modifier and Type | Field and Description |
---|---|
int |
pointer4Last |
int[] |
stamps |
T[] |
values |
Constructor and Description |
---|
TimeStamp(Store store,
T input)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
ensureCapacity(int minCapacity)
Specify least number of different values to be used by Timestamp.
|
T |
previousValue() |
void |
removeLevel(int level)
The function removes the level specified by the stamp.
|
int |
stamp()
It returns the value of the most recent stamp used within that timestamp.
|
String |
toString() |
void |
update(T val)
It updates the value of the timestamp with the provided value.
|
T |
value()
It returns the most recent value of the timestamp.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isStateful
public int pointer4Last
public transient int[] stamps
public transient T[] values
public void ensureCapacity(int minCapacity)
minCapacity
- capacity that will be ensuredpublic final T previousValue()
public void removeLevel(int level)
removeLevel
in interface Stateful
level
- the number of the level.public final int stamp()
public void update(T val)
val
- value to which the timestamp needs to be updated.public final T value()
Copyright © 2022. All rights reserved.