Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.database.connection
Class MultipleFileBasedDatabaseConnection<O extends DatabaseObject>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.database.connection.AbstractDatabaseConnection<MultiRepresentedObject<O>>
              extended by de.lmu.ifi.dbs.elki.database.connection.MultipleFileBasedDatabaseConnection<O>
All Implemented Interfaces:
DatabaseConnection<MultiRepresentedObject<O>>, Loggable, Parameterizable

public class MultipleFileBasedDatabaseConnection<O extends DatabaseObject>
extends AbstractDatabaseConnection<MultiRepresentedObject<O>>

Provides a database connection based on multiple files and parsers to be set.

Author:
Elke Achterts

Field Summary
static String DEFAULT_PARSER
          Default parser.
static String INPUT_D
          Description for parameter input.
static String INPUT_P
          Label for parameter input.
private  String[] inputFiles
          The name of the input files.
private  List<FileInputStream> inputStreams
          The input files to parse from.
static String LABEL_CONCATENATION
          A sign to separate components of a label.
static String PARSER_D
          Description of parameter parser.
static String PARSER_P
          Label for parameter parser.
private  List<Parser<O>> parsers
          The parsers.
static Pattern SPLIT
          A pattern defining a comma.
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.connection.AbstractDatabaseConnection
CLASS_LABEL_CLASS_D, CLASS_LABEL_CLASS_P, CLASS_LABEL_INDEX_D, CLASS_LABEL_INDEX_P, classLabelIndex, database, DATABASE_ID, EXTERNAL_ID_INDEX_D, EXTERNAL_ID_INDEX_P, forceExternalID
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Fields inherited from interface de.lmu.ifi.dbs.elki.database.connection.DatabaseConnection
PROPERTY_DATABASE, PROPERTY_PARSER
 
Constructor Summary
MultipleFileBasedDatabaseConnection()
          Provides a database connection expecting input from several files.
 
Method Summary
 Database<MultiRepresentedObject<O>> getDatabase(Normalization<MultiRepresentedObject<O>> normalization)
          Returns a Database according to parameter settings.
 String[] setParameters(String[] args)
          Sets the attributes of the class accordingly to the given parameters.
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.connection.AbstractDatabaseConnection
getAttributeSettings, normalizeAndTransformLabels
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, checkGlobalParameterConstraints, deleteOption, description, description, description, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, description, getParameters, getPossibleOptions, inlineDescription
 

Field Detail

LABEL_CONCATENATION

public static final String LABEL_CONCATENATION
A sign to separate components of a label.

See Also:
Constant Field Values

DEFAULT_PARSER

public static final String DEFAULT_PARSER
Default parser.


PARSER_P

public static final String PARSER_P
Label for parameter parser.

See Also:
Constant Field Values

PARSER_D

public static final String PARSER_D
Description of parameter parser.


INPUT_P

public static final String INPUT_P
Label for parameter input.

See Also:
Constant Field Values

INPUT_D

public static final String INPUT_D
Description for parameter input.

See Also:
Constant Field Values

SPLIT

public static final Pattern SPLIT
A pattern defining a comma.


parsers

private List<Parser<O extends DatabaseObject>> parsers
The parsers.


inputStreams

private List<FileInputStream> inputStreams
The input files to parse from.


inputFiles

private String[] inputFiles
The name of the input files.

Constructor Detail

MultipleFileBasedDatabaseConnection

public MultipleFileBasedDatabaseConnection()
Provides a database connection expecting input from several files.

Method Detail

getDatabase

public Database<MultiRepresentedObject<O>> getDatabase(Normalization<MultiRepresentedObject<O>> normalization)
Description copied from interface: DatabaseConnection
Returns a Database according to parameter settings.

Parameters:
normalization - Normalization to perform a normalization if this action is supported. May remain null.
Returns:
a Database according to parameter settings
See Also:
DatabaseConnection.getDatabase(de.lmu.ifi.dbs.elki.normalization.Normalization)

setParameters

public String[] setParameters(String[] args)
                       throws ParameterException
Description copied from interface: Parameterizable
Sets the attributes of the class accordingly to the given parameters. Returns a new String array containing those entries of the given array that are neither expected nor used by this Parameterizable.

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractDatabaseConnection<MultiRepresentedObject<O extends DatabaseObject>>
Parameters:
args - parameters to set the attributes accordingly to
Returns:
String[] an array containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting
See Also:
Parameterizable.setParameters(String[])

Release 0.1 (2008-07-10_1838)