Class FieldNameSelector
- java.lang.Object
-
- com.univocity.parsers.common.fields.FieldSet<java.lang.String>
-
- com.univocity.parsers.common.fields.FieldNameSelector
-
- All Implemented Interfaces:
FieldSelector
,java.lang.Cloneable
public class FieldNameSelector extends FieldSet<java.lang.String> implements FieldSelector, java.lang.Cloneable
A FieldSelector capable of selecting fields by their name.- See Also:
FieldSelector
,FieldSet
-
-
Constructor Summary
Constructors Constructor Description FieldNameSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getFieldIndex(java.lang.String header)
Returns the position of a given headerint[]
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, clone, 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
clone, describe
-
-
-
-
Method Detail
-
getFieldIndex
public int getFieldIndex(java.lang.String header)
Returns the position of a given header- Parameters:
header
- the header whose position will be returned- Returns:
- the position of the given header.
-
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.
-
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.
-
-