Top Description Constructors Methods
com.univocity.parsers.common.fields

public Class FieldNameSelector

extends FieldSet<String>
implements FieldSelector, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, com.univocity.parsers.common.fields.FieldSelector
Imports
com.univocity.parsers.common.*, java.util.*

A FieldSelector capable of selecting fields by their name.
Author
Univocity Software Pty Ltd - [email protected]
See Also
FieldSelector, FieldSet

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the position of the given header.
getFieldIndex
(String
the header whose position will be returned
header
)

Returns the position of a given header

public int[]
getFieldIndexes(NormalizedString[]
the sequence of headers that might have some elements selected by this FieldSelector
headers
)

Implements com.univocity.parsers.common.fields.FieldSelector.getFieldIndexes.

Returns the indexes of any selected fields that are part of a sequence of headers.
public int[]
getFieldIndexes(String[]
the sequence of headers that might have some elements selected by this FieldSelector
headers
)

Implements com.univocity.parsers.common.fields.FieldSelector.getFieldIndexes.

Returns the indexes of any selected fields that are part of a sequence of headers.
Inherited from com.univocity.parsers.common.fields.FieldSet:
addaddclonedescribegetremoveremovesetsettoString

Constructor Detail

FieldNameSelectorback to summary
public FieldNameSelector()

Method Detail

getFieldIndexback to summary
public int getFieldIndex(String header)

Returns the position of a given header

Parameters
header:String

the header whose position will be returned

Returns:int

the position of the given header.

getFieldIndexesback to summary
public int[] getFieldIndexes(NormalizedString[] headers)

Implements com.univocity.parsers.common.fields.FieldSelector.getFieldIndexes.

Doc from com.univocity.parsers.common.fields.FieldSelector.getFieldIndexes.

Returns the indexes of any selected fields that are part of a sequence of headers.

Parameters
headers:NormalizedString[]

the sequence of headers that might have some elements selected by this FieldSelector

Returns:int[]

the positions of all selected elements in the given headers sequence.

Annotations
@Override
getFieldIndexesback to summary
public int[] getFieldIndexes(String[] headers)

Implements com.univocity.parsers.common.fields.FieldSelector.getFieldIndexes.

Doc from com.univocity.parsers.common.fields.FieldSelector.getFieldIndexes.

Returns the indexes of any selected fields that are part of a sequence of headers.

Parameters
headers:String[]

the sequence of headers that might have some elements selected by this FieldSelector

Returns:int[]

the positions of all selected elements in the given headers sequence.

Annotations
@Override