public class SequenceBaseInformationReader extends Object implements Iterator<BaseInformationRecords.BaseInformation>, Iterable<BaseInformationRecords.BaseInformation>, Closeable
| Modifier | Constructor and Description |
|---|---|
|
SequenceBaseInformationReader(File file)
Initialize the reader.
|
protected |
SequenceBaseInformationReader(long start,
long end,
it.unimi.dsi.fastutil.io.FastBufferedInputStream stream,
String path)
Initialize the reader to read a segment of the input.
|
|
SequenceBaseInformationReader(long start,
long end,
String path)
Initialize the reader to read a segment of the input.
|
|
SequenceBaseInformationReader(String path)
Initialize the reader.
|
|
SequenceBaseInformationReader(String basename,
InputStream stream)
Initialize the reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
forEach(Consumer<? super BaseInformationRecords.BaseInformation> action) |
static String |
getBasename(String filename)
Return the basename corresponding to the input reads filename.
|
static String[] |
getBasenames(String... filenames)
Return the basenames corresponding to the input filenames.
|
long |
getCurrentReadPosition()
Gets the current position of the reader.
|
Properties |
getProperties()
Return the properties defined in the .bip file.
|
long |
getRecordsLoadedSoFar()
Gets the number of records read so far.
|
String |
getSourceSbiPath() |
long |
getTotalRecords()
Gets the total number of records.
|
boolean |
hasNext()
Returns true if the input has more sequences.
|
Iterator<BaseInformationRecords.BaseInformation> |
iterator()
Make the reader "iterable" for java "for each" loops and such.
|
BaseInformationRecords.BaseInformation |
next()
Returns the next read entry from the input stream.
|
void |
remove()
This operation is not supported.
|
void |
resetEndOffset(long endOffset)
Resets the end offset for this reader.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingspliteratorpublic SequenceBaseInformationReader(String path) throws IOException
path - Path to the input fileIOException - If an error occurs reading the inputpublic SequenceBaseInformationReader(File file) throws IOException
file - The input fileIOException - If an error occurs reading the inputpublic SequenceBaseInformationReader(String basename, InputStream stream)
basename - stream - Stream over the inputpublic SequenceBaseInformationReader(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 inputprotected SequenceBaseInformationReader(long start,
long end,
it.unimi.dsi.fastutil.io.FastBufferedInputStream stream,
String path)
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 void forEach(Consumer<? super BaseInformationRecords.BaseInformation> action)
forEach in interface Iterable<BaseInformationRecords.BaseInformation>public long getRecordsLoadedSoFar()
public long getTotalRecords()
public boolean hasNext()
hasNext in interface Iterator<BaseInformationRecords.BaseInformation>public String getSourceSbiPath()
public long getCurrentReadPosition()
public final BaseInformationRecords.BaseInformation next()
next in interface Iterator<BaseInformationRecords.BaseInformation>public void remove()
remove in interface Iterator<BaseInformationRecords.BaseInformation>public Iterator<BaseInformationRecords.BaseInformation> iterator()
iterator in interface Iterable<BaseInformationRecords.BaseInformation>public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void resetEndOffset(long endOffset)
endOffset - public static String getBasename(String filename)
filename - The name of the file to get the basename forpublic static String[] getBasenames(String... filenames)
filenames - The names of the files to get the basnames forCopyright © 2017 Campagne Laboratory. All rights reserved.