de.lmu.ifi.dbs.elki.datasource.bundle
Class MultipleObjectsBundle

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.datasource.bundle.MultipleObjectsBundle
All Implemented Interfaces:
ObjectBundle

public class MultipleObjectsBundle
extends Object
implements ObjectBundle

This class represents a set of "packaged" objects, 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.


Field Summary
private  List<List<?>> columns
          Storing the real contents.
private  BundleMeta meta
          Storing the meta data.
 
Constructor Summary
MultipleObjectsBundle()
          Constructor.
MultipleObjectsBundle(BundleMeta meta, List<List<?>> columns)
          Deprecated. 
 
Method Summary
 MultipleObjectsBundle appendColumn(SimpleTypeInformation<?> type, List<?> data)
          Helper to add a single column to the bundle.
 void appendSimple(Object... data)
          Append a new record to the data set.
 Object data(int onum, int rnum)
          Access a particular object and representation.
 int dataLength()
          Get the number of objects contained.
 List<?> getColumn(int i)
          Get the raw objects columns.
 Object[] getRow(int row)
          Get an object row.
static
<V> MultipleObjectsBundle
makeSimple(SimpleTypeInformation<? super V> type, List<? extends V> data)
          Helper to add a single column to the bundle.
static
<V1,V2> MultipleObjectsBundle
makeSimple(SimpleTypeInformation<? super V1> type1, List<? extends V1> data1, SimpleTypeInformation<? super V2> type2, List<? extends V2> data2)
          Helper to add a single column to the bundle.
static
<V1,V2,V3> MultipleObjectsBundle
makeSimple(SimpleTypeInformation<? super V1> type1, List<? extends V1> data1, SimpleTypeInformation<? super V2> type2, List<? extends V2> data2, SimpleTypeInformation<? super V3> type3, List<? extends V3> data3)
          Helper to add a single column to the bundle.
 BundleMeta meta()
          Access the meta data.
 SimpleTypeInformation<?> meta(int i)
          Access the meta data.
 int metaLength()
          Get the metadata length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

meta

private BundleMeta meta
Storing the meta data.


columns

private List<List<?>> columns
Storing the real contents.

Constructor Detail

MultipleObjectsBundle

public MultipleObjectsBundle()
Constructor.


MultipleObjectsBundle

@Deprecated
public MultipleObjectsBundle(BundleMeta meta,
                                        List<List<?>> columns)
Deprecated. 

Constructor.

Parameters:
meta - Meta data contained.
columns - Content in columns
Method Detail

meta

public BundleMeta meta()
Description copied from interface: ObjectBundle
Access the meta data.

Specified by:
meta in interface ObjectBundle
Returns:
metadata

meta

public SimpleTypeInformation<?> meta(int i)
Description copied from interface: ObjectBundle
Access the meta data.

Specified by:
meta in interface ObjectBundle
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 interface ObjectBundle
Returns:
length of metadata

data

public Object data(int onum,
                   int rnum)
Description copied from interface: ObjectBundle
Access a particular object and representation.

Specified by:
data in interface ObjectBundle
Parameters:
onum - Object number
rnum - Representation number
Returns:
Contained data

dataLength

public int dataLength()
Description copied from interface: ObjectBundle
Get the number of objects contained.

Specified by:
dataLength in interface ObjectBundle
Returns:
Number of objects

appendSimple

public void appendSimple(Object... data)
Append a new record to the data set. Pay attention to having the right number of values!

Parameters:
data - Data to append

appendColumn

public MultipleObjectsBundle appendColumn(SimpleTypeInformation<?> type,
                                          List<?> data)
Helper to add a single column to the bundle.

Parameters:
type - Type information
data - Data to add
Returns:
This object, for chaining.

getColumn

public List<?> getColumn(int i)
Get the raw objects columns. Use with caution!

Parameters:
i - column number
Returns:
the ith column

makeSimple

public static <V> MultipleObjectsBundle makeSimple(SimpleTypeInformation<? super V> type,
                                                   List<? extends V> data)
Helper to add a single column to the bundle.

Type Parameters:
V - Object type
Parameters:
type - Type information
data - Data to add

makeSimple

public static <V1,V2> MultipleObjectsBundle makeSimple(SimpleTypeInformation<? super V1> type1,
                                                       List<? extends V1> data1,
                                                       SimpleTypeInformation<? super V2> type2,
                                                       List<? extends V2> data2)
Helper to add a single column to the bundle.

Type Parameters:
V1 - First Object type
V2 - Second Object type
Parameters:
type1 - Type information
data1 - Data column to add
type2 - Second Type information
data2 - Second data column to add

makeSimple

public static <V1,V2,V3> MultipleObjectsBundle makeSimple(SimpleTypeInformation<? super V1> type1,
                                                          List<? extends V1> data1,
                                                          SimpleTypeInformation<? super V2> type2,
                                                          List<? extends V2> data2,
                                                          SimpleTypeInformation<? super V3> type3,
                                                          List<? extends V3> data3)
Helper to add a single column to the bundle.

Type Parameters:
V1 - First Object type
V2 - Second Object type
V3 - Third Object type
Parameters:
type1 - First type information
data1 - First data column to add
type2 - Second type information
data2 - Second data column to add
type3 - Third type information
data3 - Third data column to add

getRow

public Object[] getRow(int row)
Get an object row.

Parameters:
row - Row number
Returns:
Array of values

Release 0.4.0 (2011-09-20_1324)