Package elki.datasource.bundle
Class SingleObjectBundle
- java.lang.Object
-
- elki.datasource.bundle.SingleObjectBundle
-
- All Implemented Interfaces:
ObjectBundle
public class SingleObjectBundle extends java.lang.Object implements ObjectBundle
This class represents a "packaged" object, which is a transfer container for objects, e.g., from parsers to a database. It contains the object with multiple representations outside of any index structure.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.Object>contentsStoring the real contents.private DBIDidObject IDprivate BundleMetametaStore the meta data.
-
Constructor Summary
Constructors Constructor Description SingleObjectBundle()Constructor.SingleObjectBundle(BundleMeta meta, DBID id, java.util.List<java.lang.Object> contents)Constructor.SingleObjectBundle(BundleMeta meta, java.util.List<java.lang.Object> contents)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(SimpleTypeInformation<?> meta, java.lang.Object data)Append a single representation to the object.booleanassignDBID(int onum, DBIDVar var)Assign the object DBID to a variablejava.lang.Objectdata(int rnum)Get the value of the ith component.java.lang.Objectdata(int onum, int rnum)Access a particular object and representation.intdataLength()Get the number of objects contained.BundleMetameta()Access the meta data.SimpleTypeInformation<?>meta(int i)Access the meta data.intmetaLength()Get the metadata length.
-
-
-
Field Detail
-
meta
private BundleMeta meta
Store the meta data.
-
contents
private java.util.List<java.lang.Object> contents
Storing the real contents.
-
id
private DBID id
Object ID
-
-
Constructor Detail
-
SingleObjectBundle
public SingleObjectBundle()
Constructor.
-
SingleObjectBundle
public SingleObjectBundle(BundleMeta meta, java.util.List<java.lang.Object> contents)
Constructor.- Parameters:
meta- Metadatacontents- Object values
-
SingleObjectBundle
public SingleObjectBundle(BundleMeta meta, DBID id, java.util.List<java.lang.Object> contents)
Constructor.- Parameters:
meta- Metadataid- ID of objectcontents- Object values
-
-
Method Detail
-
meta
public BundleMeta meta()
Description copied from interface:ObjectBundleAccess the meta data.- Specified by:
metain interfaceObjectBundle- Returns:
- metadata
-
meta
public SimpleTypeInformation<?> meta(int i)
Description copied from interface:ObjectBundleAccess the meta data.- Specified by:
metain interfaceObjectBundle- Parameters:
i- component- Returns:
- metadata of component i
-
metaLength
public int metaLength()
Description copied from interface:ObjectBundleGet the metadata length.- Specified by:
metaLengthin interfaceObjectBundle- Returns:
- length of metadata
-
data
public java.lang.Object data(int rnum)
Get the value of the ith component.- Parameters:
rnum- representation number- Returns:
- value
-
dataLength
public int dataLength()
Description copied from interface:ObjectBundleGet the number of objects contained.- Specified by:
dataLengthin interfaceObjectBundle- Returns:
- Number of objects
-
data
public java.lang.Object data(int onum, int rnum)Description copied from interface:ObjectBundleAccess a particular object and representation.- Specified by:
datain interfaceObjectBundle- Parameters:
onum- Object numberrnum- Representation number- Returns:
- Contained data
-
assignDBID
public boolean assignDBID(int onum, DBIDVar var)Description copied from interface:ObjectBundleAssign the object DBID to a variable- Specified by:
assignDBIDin interfaceObjectBundle- Parameters:
onum- Object numbervar- Variable- Returns:
falseif there was no predefined DBID.
-
append
public void append(SimpleTypeInformation<?> meta, java.lang.Object data)
Append a single representation to the object.- Parameters:
meta- Meta for the representationdata- Data to append
-
-