Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.database.connection.AbstractDatabaseConnection<O>
          extended by de.lmu.ifi.dbs.elki.database.connection.InputStreamDatabaseConnection<O>
Type Parameters:
O - the type of DatabaseObject to be provided by the implementing class as element of the supplied database
All Implemented Interfaces:
DatabaseConnection<O>, Parameterizable
Direct Known Subclasses:
FileBasedDatabaseConnection

@Title(value="Input-Stream based database connection")
@Description(value="Parse an input stream such as STDIN into a database.")
public class InputStreamDatabaseConnection<O extends DatabaseObject>
extends AbstractDatabaseConnection<O>
implements Parameterizable

Provides a database connection expecting input from an input stream such as stdin.

Author:
Arthur Zimek

Field Summary
(package private)  InputStream in
          The input stream to parse from.
(package private)  Parser<O> parser
          Holds the instance of the parser specified by PARSER_PARAM.
static OptionID PARSER_ID
          OptionID for PARSER_PARAM
private  ObjectParameter<Parser<O>> PARSER_PARAM
          Parameter to specify the parser to provide a database, must extend Parser.
static OptionID SEED_ID
          OptionID for SEED_PARAM.
private  LongParameter SEED_PARAM
          Parameter to specify a seed for randomly shuffling the rows of the database.
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.connection.AbstractDatabaseConnection
CLASS_LABEL_CLASS_ID, CLASS_LABEL_INDEX_ID, classLabelIndex, database, DATABASE_ID, EXTERNAL_ID_INDEX_ID, LABEL_CONCATENATION
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
InputStreamDatabaseConnection(Parameterization config)
          Constructor, adhering to Parameterizable
 
Method Summary
 Database<O> getDatabase(Normalization<O> normalization)
          Returns a Database according to parameter settings.
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.connection.AbstractDatabaseConnection
normalizeAndTransformLabels
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARSER_ID

public static final OptionID PARSER_ID
OptionID for PARSER_PARAM


SEED_ID

public static final OptionID SEED_ID
OptionID for SEED_PARAM.


SEED_PARAM

private final LongParameter SEED_PARAM
Parameter to specify a seed for randomly shuffling the rows of the database. If unused, no shuffling will be performed. Shuffling takes time linearly dependent from the size of the database.

Key: -dbc.seed


PARSER_PARAM

private final ObjectParameter<Parser<O extends DatabaseObject>> PARSER_PARAM
Parameter to specify the parser to provide a database, must extend Parser.

Default value: DoubleVectorLabelParser

Key: -dbc.parser


parser

Parser<O extends DatabaseObject> parser
Holds the instance of the parser specified by PARSER_PARAM.


in

InputStream in
The input stream to parse from.

Constructor Detail

InputStreamDatabaseConnection

public InputStreamDatabaseConnection(Parameterization config)
Constructor, adhering to Parameterizable

Parameters:
config - Parameterization
Method Detail

getDatabase

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

Specified by:
getDatabase in interface DatabaseConnection<O extends DatabaseObject>
Parameters:
normalization - Normalization to perform a normalization if this action is supported. May remain null.
Returns:
a Database according to parameter settings

Release 0.3 (2010-03-31_1612)