|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.fortytwo.flow.HistorySink<T>
T - the type of data being passedpublic class HistorySink<T>
A Sink which maintains a history of items received during any given interval between calls to
its advance method.
It has a limited capacity, remembering only the latest k intervals.
| Constructor Summary | |
|---|---|
HistorySink(int capacity)
Constructs a new history sink with a given capacity |
|
| Method Summary | |
|---|---|
void |
advance()
Advances to the next step in the history |
Source<T> |
get(int index)
Retrieves a data source for a given step in the history. |
void |
put(T t)
Receives the next data item passed in. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HistorySink(int capacity)
capacity - the number of items this history sink may hold| Method Detail |
|---|
public void advance()
public void put(T t)
throws RippleException
put in interface Sink<T>t - the data item being passed
RippleException - if a data handling error occurspublic Source<T> get(int index)
index - the index of the desired step in the history.
The current step has an index of 0,
while the previous step has an index of 1, etc.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||