public static final class CollectionsPlume.RemoveFirstAndLastIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>
getFirst() and getLast() methods.| Constructor and Description |
|---|
RemoveFirstAndLastIterator(java.util.Iterator<T> itor)
Create an iterator just like
itor, except without its first and last elements. |
| Modifier and Type | Method and Description |
|---|---|
T |
getFirst()
Return the first element of the iterator that was used to construct this.
|
T |
getLast()
Return the last element of the iterator that was used to construct this.
|
boolean |
hasNext() |
T |
next() |
void |
remove() |
public RemoveFirstAndLastIterator(java.util.Iterator<T> itor)
itor, except without its first and last elements.itor - an itorator whose first and last elements to discardpublic boolean hasNext(@GuardSatisfied CollectionsPlume.RemoveFirstAndLastIterator<T> this)
hasNext in interface java.util.Iterator<T>public T next(@GuardSatisfied CollectionsPlume.RemoveFirstAndLastIterator<T> this)
next in interface java.util.Iterator<T>public T getFirst()
public T getLast()
Throws an error unless the RemoveFirstAndLastIterator has already been iterated all the way to its end (so the delegate is pointing to the last element).
public void remove(@GuardSatisfied CollectionsPlume.RemoveFirstAndLastIterator<T> this)
remove in interface java.util.Iterator<T>