Package csv.impl

Class DefaultColumnFilter

java.lang.Object
csv.impl.AbstractColumnFilter
csv.impl.DefaultColumnFilter
All Implemented Interfaces:
TableReader, java.lang.Iterable<java.lang.Object[]>, java.util.Iterator<java.lang.Object[]>

public class DefaultColumnFilter
extends AbstractColumnFilter
Implements a filter based on a given index array. You are able to filter and resort the column in each row.
Author:
ralph
  • Constructor Details

    • DefaultColumnFilter

      public DefaultColumnFilter​(TableReader reader, int[] indexOrder)
      Default Constructor
      Parameters:
      reader - underlying reader to be filtered.
      indexOrder - array of column indices to be returned from underlying reader
  • Method Details

    • getFilteredIndex

      protected int getFilteredIndex​(int originalIndex)
      Returns the index in filtered row of the specified original column index.
      Specified by:
      getFilteredIndex in class AbstractColumnFilter
      Parameters:
      originalIndex - index of value in row from underlying reader
      Returns:
      index of value in filtered row or -1 if column will not be visible.