java.util.Iterator<T>
public class PairIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>
Constructor | Description |
---|---|
PairIterator(T one,
T two) |
Create an iterator over two objects
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
hasNext() |
Returns true if the iteration has more elements.
|
T |
next() |
Returns the next element in the iteration.
|
void |
remove() |
Removes from the underlying collection the last element returned by the
iterator (optional operation).
|
public boolean hasNext()
hasNext
in interface java.util.Iterator<T>
public T next()
next
in interface java.util.Iterator<T>
java.util.NoSuchElementException
- iteration has no more elements.public void remove()
remove
in interface java.util.Iterator<T>
java.lang.UnsupportedOperationException
- if the remove
operation is not supported by this Iterator.java.lang.IllegalStateException
- if the next method has not
yet been called, or the remove method has already
been called after the last call to the next
method.