|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.util.ModIterator
public class ModIterator
Class ModIterator is a modified version of an iterator that uses less resources when only one item is available and that can (optionally) use a copy of the given list for iteration, allowing the list to be structurally modified while being iterated through. A 'Collection' may also be given.
Field Summary | |
---|---|
protected boolean |
itemsRemainingFlag
|
protected java.lang.Object |
singleItemObj
|
protected java.util.Iterator |
sourceIterObj
|
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.Iterator sourceIterObj
protected final java.lang.Object singleItemObj
protected boolean itemsRemainingFlag
Constructor Detail |
---|
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.Method Detail |
---|
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |