Package elki.datasource
Class ArrayAdapterDatabaseConnection
- java.lang.Object
-
- elki.datasource.AbstractDatabaseConnection
-
- elki.datasource.ArrayAdapterDatabaseConnection
-
- All Implemented Interfaces:
DatabaseConnection
public class ArrayAdapterDatabaseConnection extends AbstractDatabaseConnection
Import an existing data matrix (double[rows][cols]
) into an ELKI database. For efficiency, the data is not copied. If you modify the array afterwards, you can break indexes and algorithm results. It is your responsbility to not do this! Note: this class is not parameterizable, but can only be used from Java.- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class elki.datasource.AbstractDatabaseConnection
AbstractDatabaseConnection.Par
-
-
Field Summary
Fields Modifier and Type Field Description (package private) double[][]
data
The actual data.(package private) java.lang.String[]
labels
Object labels.private static Logging
LOG
Class logger.(package private) java.lang.Integer
startid
Starting ID for fixed object ids.-
Fields inherited from class elki.datasource.AbstractDatabaseConnection
filters, LABEL_CONCATENATION
-
-
Constructor Summary
Constructors Constructor Description ArrayAdapterDatabaseConnection(double[][] data)
Constructor.ArrayAdapterDatabaseConnection(double[][] data, java.lang.String[] labels)
Constructor.ArrayAdapterDatabaseConnection(double[][] data, java.lang.String[] labels, java.lang.Integer startid)
Constructor.ArrayAdapterDatabaseConnection(double[][] data, java.lang.String[] labels, java.lang.Integer startid, java.util.List<ObjectFilter> filters)
Constructor.ArrayAdapterDatabaseConnection(double[][] data, java.lang.String[] labels, java.util.List<ObjectFilter> filters)
Constructor.ArrayAdapterDatabaseConnection(double[][] data, java.util.List<ObjectFilter> filters)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Logging
getLogger()
Get the logger for this database connection.MultipleObjectsBundle
loadData()
Returns the initial data for a database.-
Methods inherited from class elki.datasource.AbstractDatabaseConnection
invokeBundleFilters, invokeStreamFilters
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
data
double[][] data
The actual data.
-
labels
java.lang.String[] labels
Object labels.
-
startid
java.lang.Integer startid
Starting ID for fixed object ids.
-
-
Constructor Detail
-
ArrayAdapterDatabaseConnection
public ArrayAdapterDatabaseConnection(double[][] data)
Constructor.- Parameters:
data
- Existing data matrix
-
ArrayAdapterDatabaseConnection
public ArrayAdapterDatabaseConnection(double[][] data, java.util.List<ObjectFilter> filters)
Constructor.- Parameters:
data
- Existing data matrixfilters
- Filters to apply, can be null
-
ArrayAdapterDatabaseConnection
public ArrayAdapterDatabaseConnection(double[][] data, java.lang.String[] labels)
Constructor.- Parameters:
data
- Existing data matrixlabels
- Object labels
-
ArrayAdapterDatabaseConnection
public ArrayAdapterDatabaseConnection(double[][] data, java.lang.String[] labels, java.util.List<ObjectFilter> filters)
Constructor.- Parameters:
data
- Existing data matrixlabels
- Object labelsfilters
- Filters to apply, can be null
-
ArrayAdapterDatabaseConnection
public ArrayAdapterDatabaseConnection(double[][] data, java.lang.String[] labels, java.lang.Integer startid)
Constructor.- Parameters:
data
- Existing data matrixlabels
- Object labelsstartid
- Starting object ID
-
ArrayAdapterDatabaseConnection
public ArrayAdapterDatabaseConnection(double[][] data, java.lang.String[] labels, java.lang.Integer startid, java.util.List<ObjectFilter> filters)
Constructor.- Parameters:
data
- Existing data matrixlabels
- Object labelsstartid
- Starting object IDfilters
- Filters to apply, can be null
-
-
Method Detail
-
loadData
public MultipleObjectsBundle loadData()
Description copied from interface:DatabaseConnection
Returns the initial data for a database.- Returns:
- a database object bundle
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractDatabaseConnection
Get the logger for this database connection.- Specified by:
getLogger
in classAbstractDatabaseConnection
- Returns:
- Logger
-
-