public class IteratorWithHistory<T> extends Object implements Iterator<T>
IteratorWithBuffer
,
PeekIterator
,
PushbackIterator
Constructor and Description |
---|
IteratorWithHistory(Iterator<T> iter,
int N) |
Modifier and Type | Method and Description |
---|---|
int |
currentSize()
Return the current size of the histiory.
|
T |
getPrevious(int idx)
return the previous i'th element returned by next().
|
boolean |
hasNext() |
T |
next() |
void |
remove() |
public T getPrevious(int idx)
IndexOutOfBoundsException
- if index is negative.public int currentSize()
Licenced under the Apache License, Version 2.0