public static class TimelineReader.Index extends Object
Constructor and Description |
---|
TimelineReader.Index(int idxInterval,
Vector<TimelineReader.IdxField> indexFields)
Constructor which builds a new index with a specific index interval and a given sample rate.
|
Modifier and Type | Method and Description |
---|---|
long |
dump(RandomAccessFile rafIn)
Method which writes an index to a RandomAccessFile
|
TimelineReader.IdxField |
getIdxField(int i) |
TimelineReader.IdxField |
getIdxFieldBefore(long timePosition)
Returns the index field that comes immediately before or straight on the requested time.
|
int |
getIdxInterval()
The interval, in samples, between two index entries.
|
int |
getNumIdx()
The number of index entries.
|
void |
load(DataInput rafIn)
Method which loads an index from a data input (random access file or data input stream).
|
void |
print()
Method which writes an index to stdout
|
public TimelineReader.Index(int idxInterval, Vector<TimelineReader.IdxField> indexFields) throws IllegalArgumentException, NullPointerException
idxInterval
- the index interval, in samples. Must be a positive number.indexFields
- the actual index data. Must not be null.IllegalArgumentException
- if the index data given is not well-formed.NullPointerException
- if indexFields are null.public void load(DataInput rafIn) throws IOException, MaryConfigurationException
rafIn
- data input from which to read the index. Must not be null, and read position must be at start of index.IOException
- if there is a problem reading.MaryConfigurationException
- if the index is not well-formed.public long dump(RandomAccessFile rafIn) throws IOException
rafIn
- rafInIOException
- IOExceptionpublic void print()
public int getNumIdx()
public int getIdxInterval()
public TimelineReader.IdxField getIdxField(int i)
public TimelineReader.IdxField getIdxFieldBefore(long timePosition)
timePosition
- the non-negative timeIllegalArgumentException
- if the given timePosition is negtiveCopyright © 2000–2016 DFKI GmbH. All rights reserved.