Package picard.util

Class TabbedTextFileWithHeaderParser

java.lang.Object
picard.util.TabbedTextFileWithHeaderParser
All Implemented Interfaces:
AutoCloseable, Iterable<TabbedTextFileWithHeaderParser.Row>

public class TabbedTextFileWithHeaderParser extends Object implements Iterable<TabbedTextFileWithHeaderParser.Row>, AutoCloseable
Parse a tabbed text file in which columns are found by looking at a header line rather than by position.
  • Constructor Details

    • TabbedTextFileWithHeaderParser

      public TabbedTextFileWithHeaderParser(TabbedInputParser parser)
    • TabbedTextFileWithHeaderParser

      public TabbedTextFileWithHeaderParser(File file)
    • TabbedTextFileWithHeaderParser

      public TabbedTextFileWithHeaderParser(File file, String[] columnHeaders)
  • Method Details

    • hasColumn

      public boolean hasColumn(String columnLabel)
      Parameters:
      columnLabel -
      Returns:
      True if the given column label appears in the header.
    • columnLabels

      public Set<String> columnLabels()
      Returns:
      The set of column labels for this file in no particular order.
    • columnLabelsList

      public List<String> columnLabelsList()
      Returns:
      The column labels for this file as a List, in no particular order.
    • iterator

      public htsjdk.samtools.util.CloseableIterator<TabbedTextFileWithHeaderParser.Row> iterator()
      Creates the iterator object. It is illegal to have more than one iterator extant on the same parser object.
      Specified by:
      iterator in interface Iterable<TabbedTextFileWithHeaderParser.Row>
    • close

      public void close()
      Release all resources associated with the parser. Iteration will not work after this has been called.
      Specified by:
      close in interface AutoCloseable
    • getCurrentLineNumber

      public int getCurrentLineNumber()
    • getColumnNames

      public Set<String> getColumnNames()