Package com.opencsv.bean
Class PositionToBeanField.PositionIterator
java.lang.Object
com.opencsv.bean.PositionToBeanField.PositionIterator
- All Implemented Interfaces:
Iterator<FieldMapByPositionEntry<T>>
- Enclosing class:
PositionToBeanField<T>
private class PositionToBeanField.PositionIterator
extends Object
implements Iterator<FieldMapByPositionEntry<T>>
This iterator is designed to iterate over every element of all of the
ranges specified in the containing class.
There is no guaranteed order.
There is one exception to returning all values: if a range ends at
Integer.MAX_VALUE
, only the minimum in the range is returned.
This is to prevent a loop that for all practical purposes might as well
be infinite. Unless someone foolishly specifies Integer.MAX_VALUE
as a column position, this only occurs after reading in ranges and before
the first line of the input is read. There is no reason in the opencsv
code to iterate at this point, and it is not done. There should be no
reason for user code to use this iterator at all, but if it does, the
user is herewith warned.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.commons.lang3.Range
<Integer> private int
private ListIterator
<org.apache.commons.lang3.Range<Integer>> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
rangeIterator
-
currentRange
-
position
private int position
-
-
Constructor Details
-
PositionIterator
PositionIterator()
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<FieldMapByPositionEntry<T>>
-
next
- Specified by:
next
in interfaceIterator<FieldMapByPositionEntry<T>>
-
remove
public void remove()- Specified by:
remove
in interfaceIterator<FieldMapByPositionEntry<T>>
-