Package elki.datasource.bundle
Class StreamFromBundle
- java.lang.Object
-
- elki.datasource.bundle.StreamFromBundle
-
- All Implemented Interfaces:
BundleStreamSource
public class StreamFromBundle extends java.lang.Object implements BundleStreamSource
Convert a MultipleObjectsBundle to a stream. To use this, invokeMultipleObjectsBundle.asStream()
.- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.datasource.bundle.BundleStreamSource
BundleStreamSource.Event
-
-
Field Summary
Fields Modifier and Type Field Description (package private) MultipleObjectsBundle
bundle
Bundle to access(package private) int
onum
Offset in bundle
-
Constructor Summary
Constructors Constructor Description StreamFromBundle(MultipleObjectsBundle bundle)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultipleObjectsBundle
asMultipleObjectsBundle()
Return (or collect) the stream as bundle.boolean
assignDBID(DBIDVar var)
Assign the current object ID to aDBIDVar
.java.lang.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
-
-
-
Field Detail
-
bundle
MultipleObjectsBundle bundle
Bundle to access
-
onum
int onum
Offset in bundle
-
-
Constructor Detail
-
StreamFromBundle
public StreamFromBundle(MultipleObjectsBundle bundle)
Constructor.- Parameters:
bundle
- Existing object bundle
-
-
Method Detail
-
getMeta
public BundleMeta getMeta()
Description copied from interface:BundleStreamSource
Get the current meta data.- Specified by:
getMeta
in interfaceBundleStreamSource
- Returns:
- Metadata
-
data
public java.lang.Object data(int rnum)
Description copied from interface:BundleStreamSource
Access a particular object and representation.- Specified by:
data
in interfaceBundleStreamSource
- Parameters:
rnum
- Representation number- Returns:
- Contained data
-
hasDBIDs
public boolean hasDBIDs()
Description copied from interface:BundleStreamSource
Indicate whether the stream contains DBIDs.- Specified by:
hasDBIDs
in interfaceBundleStreamSource
- Returns:
true
if the stream contains DBIDs.
-
assignDBID
public boolean assignDBID(DBIDVar var)
Description copied from interface:BundleStreamSource
Assign the current object ID to aDBIDVar
.- Specified by:
assignDBID
in interfaceBundleStreamSource
- Parameters:
var
- Variable to assign the object id to- Returns:
false
when no object id is available
-
nextEvent
public BundleStreamSource.Event nextEvent()
Description copied from interface:BundleStreamSource
Get the next event- Specified by:
nextEvent
in interfaceBundleStreamSource
- Returns:
- Event type
-
asMultipleObjectsBundle
public MultipleObjectsBundle asMultipleObjectsBundle()
Description copied from interface:BundleStreamSource
Return (or collect) the stream as bundle.- Specified by:
asMultipleObjectsBundle
in interfaceBundleStreamSource
- Returns:
- Bundle
-
-