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) MultipleObjectsBundlebundleBundle to access(package private) intonumOffset in bundle
-
Constructor Summary
Constructors Constructor Description StreamFromBundle(MultipleObjectsBundle bundle)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultipleObjectsBundleasMultipleObjectsBundle()Return (or collect) the stream as bundle.booleanassignDBID(DBIDVar var)Assign the current object ID to aDBIDVar.java.lang.Objectdata(int rnum)Access a particular object and representation.BundleMetagetMeta()Get the current meta data.booleanhasDBIDs()Indicate whether the stream contains DBIDs.BundleStreamSource.EventnextEvent()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:BundleStreamSourceGet the current meta data.- Specified by:
getMetain interfaceBundleStreamSource- Returns:
- Metadata
-
data
public java.lang.Object data(int rnum)
Description copied from interface:BundleStreamSourceAccess a particular object and representation.- Specified by:
datain interfaceBundleStreamSource- Parameters:
rnum- Representation number- Returns:
- Contained data
-
hasDBIDs
public boolean hasDBIDs()
Description copied from interface:BundleStreamSourceIndicate whether the stream contains DBIDs.- Specified by:
hasDBIDsin interfaceBundleStreamSource- Returns:
trueif the stream contains DBIDs.
-
assignDBID
public boolean assignDBID(DBIDVar var)
Description copied from interface:BundleStreamSourceAssign the current object ID to aDBIDVar.- Specified by:
assignDBIDin interfaceBundleStreamSource- Parameters:
var- Variable to assign the object id to- Returns:
falsewhen no object id is available
-
nextEvent
public BundleStreamSource.Event nextEvent()
Description copied from interface:BundleStreamSourceGet the next event- Specified by:
nextEventin interfaceBundleStreamSource- Returns:
- Event type
-
asMultipleObjectsBundle
public MultipleObjectsBundle asMultipleObjectsBundle()
Description copied from interface:BundleStreamSourceReturn (or collect) the stream as bundle.- Specified by:
asMultipleObjectsBundlein interfaceBundleStreamSource- Returns:
- Bundle
-
-