public class ModIterator
extends java.lang.Object
implements java.util.Iterator, java.util.Enumeration
Modifier and Type | Field and Description |
---|---|
protected boolean |
itemsRemainingFlag |
protected java.lang.Object |
singleItemObj |
protected java.util.Iterator |
sourceIterObj |
Constructor and Description |
---|
ModIterator(java.util.Collection listObj)
Creates a modified version of an iterator.
|
ModIterator(java.util.Collection listObj,
boolean useCopyFlag)
Creates a modified version of an iterator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasMoreElements()
Returns true if the enumeration has more elements.
|
boolean |
hasNext()
Returns true if the iteration has more elements.
|
java.lang.Object |
next()
Returns the next element in the iteration.
|
java.lang.Object |
nextElement()
Returns the next element in the enumeration.
|
void |
remove()
This operation is not supported.
|
protected final java.util.Iterator sourceIterObj
protected final java.lang.Object singleItemObj
protected boolean itemsRemainingFlag
public ModIterator(java.util.Collection listObj, boolean useCopyFlag)
listObj
- the 'List' (or 'Collection') object to be iterated
though, or null for none.useCopyFlag
- if true then a copy of the given list is used for
iteration, allowing the list to be structurally modified while being
iterated through.public ModIterator(java.util.Collection listObj)
listObj
- the 'List' (or 'Collection') object to be iterated
though, or null for none.public boolean hasMoreElements()
hasMoreElements
in interface java.util.Enumeration
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
java.util.NoSuchElementException
- if the iteration has no more
elements.public java.lang.Object nextElement()
nextElement
in interface java.util.Enumeration
java.util.NoSuchElementException
- if the enumeration has no more
elements.public void remove()
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- always throws this exception.