public class SequenceSegmentInformationReader extends Object implements Iterator<SegmentInformationRecords.SegmentInformation>, Iterable<SegmentInformationRecords.SegmentInformation>, Closeable
| Constructor and Description |
|---|
SequenceSegmentInformationReader(File file)
Initialize the reader.
|
SequenceSegmentInformationReader(long start,
long end,
it.unimi.dsi.fastutil.io.FastBufferedInputStream stream)
Initialize the reader to read a segment of the input.
|
SequenceSegmentInformationReader(long start,
long end,
String path)
Initialize the reader to read a segment of the input.
|
SequenceSegmentInformationReader(String path)
Initialize the reader.
|
SequenceSegmentInformationReader(String basename,
InputStream stream)
Initialize the reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream and releases any system resources associated
with it.
|
String |
getBasename(String filename)
Remove the .ssi or .ssip extension if the filename has it.
|
Properties |
getProperties()
Return the properties defined in the .bip file.
|
long |
getRecordsLoadedSoFar()
Gets the number of records read so far.
|
long |
getTotalRecords()
Gets the total number of records.
|
boolean |
hasNext()
Returns
true if the iteration has more elements. |
Iterator<SegmentInformationRecords.SegmentInformation> |
iterator()
Returns an iterator over elements of type
T. |
SegmentInformationRecords.SegmentInformation |
next()
Returns the next segment in the iteration.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removeforEach, spliteratorpublic SequenceSegmentInformationReader(String path) throws IOException
path - Path to the input fileIOException - If an error occurs reading the inputpublic SequenceSegmentInformationReader(File file) throws IOException
file - The input fileIOException - If an error occurs reading the inputpublic SequenceSegmentInformationReader(String basename, InputStream stream)
basename - stream - Stream over the inputpublic SequenceSegmentInformationReader(long start,
long end,
String path)
throws IOException
hasNext() and next().start - Start offset in the input fileend - End offset in the input filepath - Path to the input fileIOException - If an error occurs reading the inputpublic SequenceSegmentInformationReader(long start,
long end,
it.unimi.dsi.fastutil.io.FastBufferedInputStream stream)
throws IOException
hasNext() and next().start - Start offset in the input fileend - End offset in the input filestream - Stream over the input fileIOException - If an error occurs reading the input.public Properties getProperties()
public long getRecordsLoadedSoFar()
public long getTotalRecords()
public void close()
throws IOException
As noted in AutoCloseable.close(), cases where the
close may fail require careful attention. It is strongly advised
to relinquish the underlying resources and to internally
mark the Closeable as closed, prior to throwing
the IOException.
close in interface Closeableclose in interface AutoCloseableIOException - if an I/O error occurspublic Iterator<SegmentInformationRecords.SegmentInformation> iterator()
T.iterator in interface Iterable<SegmentInformationRecords.SegmentInformation>public boolean hasNext()
true if the iteration has more elements.
(In other words, returns true if next() would
return an element rather than throwing an exception.)hasNext in interface Iterator<SegmentInformationRecords.SegmentInformation>true if the iteration has more elementspublic SegmentInformationRecords.SegmentInformation next()
next in interface Iterator<SegmentInformationRecords.SegmentInformation>NoSuchElementException - if the iteration has no more segmentsCopyright © 2018 Campagne Laboratory. All rights reserved.