Package org.jibx.runtime.impl
Class ArrayRangeIterator
java.lang.Object
org.jibx.runtime.impl.ArrayRangeIterator
- All Implemented Interfaces:
Iterator
Iterator class for values contained in an array range. This type of iterator
can be used for any contiguous range of items in an object array.
- Version:
- 1.1
- Author:
- Dennis M. Sosnoski
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ArrayRangeIteratorEmpty iterator used whenever possible.protected Object[]Array supplying values for iteration.protected intEnding offset for values.protected intOffset of next iteration value. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateArrayRangeIterator(Object[] array, int start, int limit) Internal constructor. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
EMPTY_ITERATOR
Empty iterator used whenever possible. -
m_array
Array supplying values for iteration. -
m_offset
protected int m_offsetOffset of next iteration value. -
m_limit
protected int m_limitEnding offset for values.
-
-
Constructor Details
-
ArrayRangeIterator
Internal constructor.- Parameters:
array- array containing values to be iteratedstart- starting offset in arraylimit- offset past end of values
-
-
Method Details
-
hasNext
public boolean hasNext()Check for iteration element available. -
next
Get next iteration element.- Specified by:
nextin interfaceIterator- Returns:
- next iteration element
- Throws:
NoSuchElementException- if past end of iteration
-
remove
public void remove()Remove element from iteration. This optional operation is not supported and always throws an exception.- Specified by:
removein interfaceIterator- Throws:
UnsupportedOperationException- for unsupported operation
-
buildIterator
Build iterator.- Parameters:
array- array containing values to be iterated (may benull)start- starting offset in arraylimit- offset past end of values- Returns:
- constructed iterator
-