
public class BundleReader extends Object implements BundleStreamSource
BundleStreamSource.Event| Modifier and Type | Field and Description |
|---|---|
(package private) MappedByteBuffer |
buffer
The stream buffer.
|
(package private) Object[] |
data
Current object.
|
(package private) boolean |
hasids
Whether or not we have DBIDs.
|
(package private) FileChannel |
input
Input channel.
|
static int |
MAGIC
Magic number, shared with
BundleReader. |
(package private) BundleMeta |
meta
Bundle metadata.
|
(package private) ByteBufferSerializer<?>[] |
sers
Serializers to use.
|
| Constructor and Description |
|---|
BundleReader(FileChannel input)
Constructor.
|
BundleReader(MappedByteBuffer buffer)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
MultipleObjectsBundle |
asMultipleObjectsBundle()
Return (or collect) the stream as bundle.
|
boolean |
assignDBID(DBIDVar var)
Assign the current object ID to a
DBIDVar. |
Object |
data(int rnum)
Access a particular object and representation.
|
BundleMeta |
getMeta()
Get the current meta data.
|
boolean |
hasDBIDs()
Indicate whether the stream contains DBIDs.
|
BundleStreamSource.Event |
nextEvent()
Get the next event
|
(package private) void |
openBuffer()
Map the input file.
|
(package private) void |
readMeta()
Read the metadata.
|
(package private) void |
readObject()
Read an object.
|
public static final int MAGIC
BundleReader.MappedByteBuffer buffer
BundleMeta meta
FileChannel input
ByteBufferSerializer<?>[] sers
Object[] data
boolean hasids
public BundleReader(MappedByteBuffer buffer)
buffer - Input bufferpublic BundleReader(FileChannel input)
input - Input channelpublic BundleMeta getMeta()
BundleStreamSourcegetMeta in interface BundleStreamSourcevoid openBuffer()
void readMeta()
void readObject()
public BundleStreamSource.Event nextEvent()
BundleStreamSourcenextEvent in interface BundleStreamSourcepublic Object data(int rnum)
BundleStreamSourcedata in interface BundleStreamSourcernum - Representation numberpublic boolean hasDBIDs()
BundleStreamSourcehasDBIDs in interface BundleStreamSourcetrue if the stream contains DBIDs.public boolean assignDBID(DBIDVar var)
BundleStreamSourceDBIDVar.assignDBID in interface BundleStreamSourcevar - Variable to assign the object id tofalse when no object id is availablepublic MultipleObjectsBundle asMultipleObjectsBundle()
BundleStreamSourceasMultipleObjectsBundle in interface BundleStreamSourceCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.