|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jrdf.util.IteratorStack<T>
public class IteratorStack<T>
Wraps an Iterator to provide a stack interface to it's contents.
| Constructor Summary | |
|---|---|
IteratorStack(Iterator<T> newIter)
Creates a new stack that wraps the Iterator. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
|
T |
next()
|
T |
peek()
Returns the next item on the stack without removing it. |
T |
pop()
Removes the next item from the stack and returns it. |
void |
push(T item)
Pushes the item onto the stack. |
void |
remove()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IteratorStack(Iterator<T> newIter)
newIter - Iterator| Method Detail |
|---|
public T peek()
public T pop()
public void push(T item)
item - to be place on top of the stackpublic boolean hasNext()
hasNext in interface Iterator<T>public T next()
next in interface Iterator<T>
public void remove()
throws UnsupportedOperationException
remove in interface Iterator<T>UnsupportedOperationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||