BeanField.
| Modifier and Type | Class and Description |
|---|---|
| private class | PositionToBeanField.
This iterator is designed to iterate over every element of all of the ranges specified in the containing class. |
| Modifier and Type | Field and Description |
|---|---|
| private final String | initializer
This is the string used to initialize this set of ranges. |
| private final List | ranges
A list of ranges of column indices that should be mapped to the associated bean. |
| Access | Constructor and Description |
|---|---|
| public | PositionToBeanField(final String
A definition of ranges as documented in
rangeDefinition, int CsvBindAndJoinByPosition#position()The maximum index allowed for a range. Ranges will be
adjusted as documented in maxIndex, final BeanField<T, Integer> attenuateRanges(int).The field, Locale BeanField this mapping maps toThe locale for error messages errorLocale)Initializes this mapping with a list of ranges and the associated
|
| Modifier and Type | Method and Description |
|---|---|
| public void | attenuateRanges(int
The new maximum for ranges maxIndex)If there are ranges in the list of ranges encompassed by this mapping that stretch beyond the maximum index given, they are shortened to be no longer than the maximum index. |
| public boolean | contains(Integer key)
Implements com. Determines whether or not the given key is contained in this entry. |
| public String | getInitializer()
Implements com. Returns the information used to initialize this entry. |
| public Iterator |
| initializer | back to summary |
|---|---|
| private final String initializer This is the string used to initialize this set of ranges.
This is necessary because the ranges may be attenuated later by
| |
| ranges | back to summary |
|---|---|
| private final List<Range<Integer>> ranges A list of ranges of column indices that should be mapped to the associated bean. | |
| PositionToBeanField | back to summary |
|---|---|
| public PositionToBeanField(final String rangeDefinition, int maxIndex, final BeanField<T, Integer> field, Locale errorLocale) Initializes this mapping with a list of ranges and the associated
| |
| attenuateRanges | back to summary |
|---|---|
| public void attenuateRanges(int maxIndex) If there are ranges in the list of ranges encompassed by this mapping that stretch beyond the maximum index given, they are shortened to be no longer than the maximum index. Ranges that lie completely beyond the maximum index are shortened to a one-element range consisting of the range's lower boundary. No ranges are under any circumstances removed, as this might compromise checks for required fields.
| |
| contains | back to summary |
|---|---|
| public boolean contains(Integer key) Implements com. Doc from com. Determines whether or not the given key is contained in this entry.
| |
| getInitializer | back to summary |
|---|---|
| public String getInitializer() Implements com. Doc from com. Returns the information used to initialize this entry. This information is not guaranteed to be exactly the same as the original value, but is functionally equivalent.
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over elements of type
| |
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.
| Modifier and Type | Field and Description |
|---|---|
| private Range | |
| private int | |
| private ListIterator |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public FieldMapByPositionEntry | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| currentRange | back to summary |
|---|---|
| private Range<Integer> currentRange | |
| position | back to summary |
|---|---|
| private int position | |
| rangeIterator | back to summary |
|---|---|
| private ListIterator<Range<Integer>> rangeIterator | |
| PositionIterator | back to summary |
|---|---|
| pack-priv PositionIterator() | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public FieldMapByPositionEntry Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |