Class FieldEnumSelector
- java.lang.Object
-
- com.univocity.parsers.common.fields.FieldSet<java.lang.Enum>
-
- com.univocity.parsers.common.fields.FieldEnumSelector
-
- All Implemented Interfaces:
FieldSelector
,java.lang.Cloneable
public class FieldEnumSelector extends FieldSet<java.lang.Enum> implements FieldSelector
A FieldSelector capable of selecting fields represented by values of an enumeration type. ThetoString()
output of the enumeration value will be used to match name of the fields.- See Also:
FieldSelector
,FieldSet
-
-
Field Summary
Fields Modifier and Type Field Description private FieldNameSelector
names
-
Constructor Summary
Constructors Constructor Description FieldEnumSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldEnumSelector
clone()
Clones this field selector.int
getFieldIndex(java.lang.Enum column)
Returns the position of a given column represented by an enumeration value.int[]
getFieldIndexes(NormalizedString[] headers)
Returns the indexes of any selected fields that are part of a sequence of headers.int[]
getFieldIndexes(java.lang.String[] headers)
Returns the indexes of any selected fields that are part of a sequence of headers.-
Methods inherited from class com.univocity.parsers.common.fields.FieldSet
add, add, describe, get, remove, remove, set, set, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.univocity.parsers.common.fields.FieldSelector
describe
-
-
-
-
Field Detail
-
names
private FieldNameSelector names
-
-
Method Detail
-
getFieldIndex
public int getFieldIndex(java.lang.Enum column)
Returns the position of a given column represented by an enumeration value.- Parameters:
column
- the column whose position will be returned- Returns:
- the position of the given column.
-
getFieldIndexes
public int[] getFieldIndexes(NormalizedString[] headers)
Description copied from interface:FieldSelector
Returns the indexes of any selected fields that are part of a sequence of headers.- Specified by:
getFieldIndexes
in interfaceFieldSelector
- Parameters:
headers
- the sequence of headers that might have some elements selected by this FieldSelector- Returns:
- the positions of all selected elements in the given headers sequence.
-
clone
public FieldEnumSelector clone()
Description copied from interface:FieldSelector
Clones this field selector. Changes to the selection on the clone won't be reflected on the original- Specified by:
clone
in interfaceFieldSelector
- Overrides:
clone
in classFieldSet<java.lang.Enum>
- Returns:
- a copy of the current field selector.
-
getFieldIndexes
public int[] getFieldIndexes(java.lang.String[] headers)
Description copied from interface:FieldSelector
Returns the indexes of any selected fields that are part of a sequence of headers.- Specified by:
getFieldIndexes
in interfaceFieldSelector
- Parameters:
headers
- the sequence of headers that might have some elements selected by this FieldSelector- Returns:
- the positions of all selected elements in the given headers sequence.
-
-