Class FieldNameSelector

java.lang.Object
com.univocity.parsers.common.fields.FieldSet<String>
com.univocity.parsers.common.fields.FieldNameSelector
All Implemented Interfaces:
FieldSelector, Cloneable

public class FieldNameSelector extends FieldSet<String> implements FieldSelector, Cloneable
A FieldSelector capable of selecting fields by their name.
See Also:
  • Constructor Details

    • FieldNameSelector

      public FieldNameSelector()
  • Method Details

    • getFieldIndex

      public int getFieldIndex(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 interface FieldSelector
      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(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 interface FieldSelector
      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.