Package picard.util
Class DelimitedTextFileWithHeaderIterator
- java.lang.Object
-
- picard.util.DelimitedTextFileWithHeaderIterator
-
- All Implemented Interfaces:
htsjdk.samtools.util.CloseableIterator<DelimitedTextFileWithHeaderIterator.Row>
,Closeable
,AutoCloseable
,Iterator<DelimitedTextFileWithHeaderIterator.Row>
public class DelimitedTextFileWithHeaderIterator extends Object implements htsjdk.samtools.util.CloseableIterator<DelimitedTextFileWithHeaderIterator.Row>
Iterate through a delimited text file in which columns are found by looking at a header line rather than by position. TODO: This effectively replaces TabbedTextFileWithHeaderParser although the latter hasn't been modified to use this code instead.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DelimitedTextFileWithHeaderIterator.Row
-
Constructor Summary
Constructors Constructor Description DelimitedTextFileWithHeaderIterator(BasicInputParser parser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Set<String>
columnLabels()
Set<String>
getColumnNames()
int
getCurrentLineNumber()
boolean
hasColumn(String columnLabel)
boolean
hasNext()
DelimitedTextFileWithHeaderIterator.Row
next()
void
remove()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
DelimitedTextFileWithHeaderIterator
public DelimitedTextFileWithHeaderIterator(BasicInputParser parser)
-
-
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.
-
getCurrentLineNumber
public int getCurrentLineNumber()
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceIterator<DelimitedTextFileWithHeaderIterator.Row>
-
next
public DelimitedTextFileWithHeaderIterator.Row next()
- Specified by:
next
in interfaceIterator<DelimitedTextFileWithHeaderIterator.Row>
-
remove
public void remove()
- Specified by:
remove
in interfaceIterator<DelimitedTextFileWithHeaderIterator.Row>
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfacehtsjdk.samtools.util.CloseableIterator<DelimitedTextFileWithHeaderIterator.Row>
-
-