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>
contents
Storing the real contents.private DBID
id
Object IDprivate BundleMeta
meta
Store 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 void
append(SimpleTypeInformation<?> meta, java.lang.Object data)
Append a single representation to the object.boolean
assignDBID(int onum, DBIDVar var)
Assign the object DBID to a variablejava.lang.Object
data(int rnum)
Get the value of the ith component.java.lang.Object
data(int onum, int rnum)
Access a particular object and representation.int
dataLength()
Get the number of objects contained.BundleMeta
meta()
Access the meta data.SimpleTypeInformation<?>
meta(int i)
Access the meta data.int
metaLength()
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:ObjectBundle
Access the meta data.- Specified by:
meta
in interfaceObjectBundle
- Returns:
- metadata
-
meta
public SimpleTypeInformation<?> meta(int i)
Description copied from interface:ObjectBundle
Access the meta data.- Specified by:
meta
in interfaceObjectBundle
- Parameters:
i
- component- Returns:
- metadata of component i
-
metaLength
public int metaLength()
Description copied from interface:ObjectBundle
Get the metadata length.- Specified by:
metaLength
in 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:ObjectBundle
Get the number of objects contained.- Specified by:
dataLength
in interfaceObjectBundle
- Returns:
- Number of objects
-
data
public java.lang.Object data(int onum, int rnum)
Description copied from interface:ObjectBundle
Access a particular object and representation.- Specified by:
data
in interfaceObjectBundle
- Parameters:
onum
- Object numberrnum
- Representation number- Returns:
- Contained data
-
assignDBID
public boolean assignDBID(int onum, DBIDVar var)
Description copied from interface:ObjectBundle
Assign the object DBID to a variable- Specified by:
assignDBID
in interfaceObjectBundle
- Parameters:
onum
- Object numbervar
- Variable- Returns:
false
if 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
-
-