|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.pogamut.Client.HistoryIterator
public class HistoryIterator
HistoryIterator is an iterator for History
it has two kinds of next and hasNext according to the value of unique
in both cases it iterates through first batch and, after exhausting this one, proceed to next batch until it reaches the last batch or the specified depth
it iterates only through items of specified type
Field Summary | |
---|---|
private HistoryBatch |
actualBatch
actual History Batch - for iteration through History |
private int |
actualDepth
actual depth of iteration |
private MessageObject |
actualMessage
necessary for unique iterator - keeps actual message |
private int |
depth
identifies depth of iteration (number of batches to go through) |
private java.util.HashSet<java.lang.Integer> |
iteratedIDs
necessary for unique iterator - keeps sended messages - their IDs |
private MessageType |
type
type of MessageObject |
private boolean |
unique
distinguish returning all messages from returning only unique messages (unique according to ID) |
private java.util.Iterator<MessageObject> |
valueSetIterator
for iteration through HashMap in HistoryBatch |
Constructor Summary | |
---|---|
HistoryIterator(int depth,
MessageType type,
boolean unique,
HistoryBatch actualBatch)
|
Method Summary | |
---|---|
boolean |
hasNext()
|
boolean |
hasNextNormal()
returns true if there is any other next item of proper type in proper depth |
boolean |
hasNextUnique()
returns true if there is any next item, which was not send yet |
java.lang.Object |
next()
|
java.lang.Object |
nextNormal()
|
java.lang.Object |
nextUnique()
|
void |
remove()
Not implemented!!! |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int depth
private int actualDepth
private boolean unique
private MessageType type
private HistoryBatch actualBatch
private java.util.Iterator<MessageObject> valueSetIterator
private java.util.HashSet<java.lang.Integer> iteratedIDs
private MessageObject actualMessage
Constructor Detail |
---|
public HistoryIterator(int depth, MessageType type, boolean unique, HistoryBatch actualBatch)
Method Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
public boolean hasNextNormal()
public java.lang.Object nextNormal()
public boolean hasNextUnique()
public java.lang.Object nextUnique()
public void remove()
remove
in interface java.util.Iterator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |