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.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.database.connection.AbstractDatabaseConnection<O>
              extended by de.lmu.ifi.dbs.elki.database.connection.InputStreamDatabaseConnection<O>
All Implemented Interfaces:
DatabaseConnection<O>, Loggable, Parameterizable
Direct Known Subclasses:
FileBasedDatabaseConnection

public class InputStreamDatabaseConnection<O extends DatabaseObject>
extends AbstractDatabaseConnection<O>

Provides a database connection expecting input from standard in.

Author:
Arthur Zimek

Field Summary
static String DEFAULT_PARSER
          Default parser.
(package private)  InputStream in
          The input to parse from.
(package private)  Parser<O> parser
          The parser.
static String PARSER_D
          Description of parameter parser.
static String PARSER_P
          Label for parameter parser.
 
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, LABEL_CONCATENATION
 
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
InputStreamDatabaseConnection()
          Provides a database connection expecting input from standard in.
 
Method Summary
 String description()
          Returns a description of the class and the required parameters.
 List<AttributeSettings> getAttributeSettings()
          Returns the parameter setting of the attributes.
 Database<O> getDatabase(Normalization<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
normalizeAndTransformLabels
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, checkGlobalParameterConstraints, deleteOption, 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, getParameters, getPossibleOptions, inlineDescription
 

Field Detail

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.


parser

Parser<O extends DatabaseObject> parser
The parser.


in

InputStream in
The input to parse from.

Constructor Detail

InputStreamDatabaseConnection

public InputStreamDatabaseConnection()
Provides a database connection expecting input from standard in.

Method Detail

getDatabase

public Database<O> getDatabase(Normalization<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(Normalization)

description

public String description()
Description copied from interface: Parameterizable
Returns a description of the class and the required parameters.

This description should be suitable for a usage description as for a standalone application.

Specified by:
description in interface Parameterizable
Overrides:
description in class AbstractParameterizable
Returns:
String a description of the class and the required parameters
See Also:
Parameterizable.description()

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<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(java.lang.String[])

getAttributeSettings

public List<AttributeSettings> getAttributeSettings()
Returns the parameter setting of the attributes.

Specified by:
getAttributeSettings in interface Parameterizable
Overrides:
getAttributeSettings in class AbstractDatabaseConnection<O extends DatabaseObject>
Returns:
the parameter setting of the attributes
See Also:
Parameterizable.getAttributeSettings()

Release 0.1 (2008-07-10_1838)