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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
TabbedTextFileWithHeaderParser.Row
-
Constructor Summary
Constructors Constructor Description TabbedTextFileWithHeaderParser(File file)
TabbedTextFileWithHeaderParser(File file, String[] columnHeaders)
TabbedTextFileWithHeaderParser(TabbedInputParser parser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Release all resources associated with the parser.Set<String>
columnLabels()
List<String>
columnLabelsList()
Set<String>
getColumnNames()
int
getCurrentLineNumber()
boolean
hasColumn(String columnLabel)
htsjdk.samtools.util.CloseableIterator<TabbedTextFileWithHeaderParser.Row>
iterator()
Creates the iterator object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
TabbedTextFileWithHeaderParser
public TabbedTextFileWithHeaderParser(TabbedInputParser parser)
-
TabbedTextFileWithHeaderParser
public TabbedTextFileWithHeaderParser(File file)
-
-
Method Detail
-
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 interfaceIterable<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 interfaceAutoCloseable
-
getCurrentLineNumber
public int getCurrentLineNumber()
-
-