Package com.opencsv.bean
Class PositionToBeanField.PositionIterator
- java.lang.Object
-
- com.opencsv.bean.PositionToBeanField.PositionIterator
-
- All Implemented Interfaces:
java.util.Iterator<FieldMapByPositionEntry<T>>
- Enclosing class:
- PositionToBeanField<T>
private class PositionToBeanField.PositionIterator extends java.lang.Object implements java.util.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 specifiesInteger.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
Fields Modifier and Type Field Description private org.apache.commons.lang3.Range<java.lang.Integer>
currentRange
private int
position
private java.util.ListIterator<org.apache.commons.lang3.Range<java.lang.Integer>>
rangeIterator
-
Constructor Summary
Constructors Constructor Description PositionIterator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
FieldMapByPositionEntry<T>
next()
void
remove()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<FieldMapByPositionEntry<T>>
-
next
public FieldMapByPositionEntry<T> next()
- Specified by:
next
in interfacejava.util.Iterator<FieldMapByPositionEntry<T>>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<FieldMapByPositionEntry<T>>
-
-