de.lmu.ifi.dbs.elki.database.connection
Class FileBasedDatabaseConnection<O extends DatabaseObject>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.database.connection.AbstractDatabaseConnection<O>
de.lmu.ifi.dbs.elki.database.connection.InputStreamDatabaseConnection<O>
de.lmu.ifi.dbs.elki.database.connection.FileBasedDatabaseConnection<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
public class FileBasedDatabaseConnection<O extends DatabaseObject>
- extends InputStreamDatabaseConnection<O>
Provides a file based database connection based on the parser to be set.
- Author:
- Arthur Zimek
Constructor Summary |
FileBasedDatabaseConnection()
Provides a file based database connection based on the parser to be set,
adding parameter INPUT_PARAM to the option handler additionally to
parameters of super class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INPUT_ID
public static final OptionID INPUT_ID
- OptionID for
INPUT_PARAM
INPUT_PARAM
private final FileParameter INPUT_PARAM
- Parameter that specifies the name of the input file to be parsed.
Key: -dbc.in
FileBasedDatabaseConnection
public FileBasedDatabaseConnection()
- Provides a file based database connection based on the parser to be set,
adding parameter
INPUT_PARAM
to the option handler additionally to
parameters of super class.
setParameters
public List<String> setParameters(List<String> args)
throws ParameterException
- Calls the super method InputStreamDatabaseConnection#setParameters(args)}
and sets additionally the value of the parameter
INPUT_PARAM
.
- Specified by:
setParameters
in interface Parameterizable
- Overrides:
setParameters
in class InputStreamDatabaseConnection<O extends DatabaseObject>
- Parameters:
args
- parameters to set the attributes accordingly to
- Returns:
- a list containing the unused parameters
- Throws:
ParameterException
- in case of wrong parameter-setting
tryGzipInput
public static InputStream tryGzipInput(InputStream in)
throws IOException
- Try to open a stream as gzip, if it starts with the gzip magic.
TODO: move to utils package.
- Parameters:
in
- original input stream
- Returns:
- old input stream or a
GZIPInputStream
if appropriate.
- Throws:
IOException