Package elki.datasource
Class InputStreamDatabaseConnection
- java.lang.Object
-
- elki.datasource.AbstractDatabaseConnection
-
- elki.datasource.InputStreamDatabaseConnection
-
- All Implemented Interfaces:
DatabaseConnection
,java.lang.AutoCloseable
- Direct Known Subclasses:
FileBasedDatabaseConnection
@Title("Input-Stream based database connection") @Description("Parse an input stream such as STDIN into a database.") public class InputStreamDatabaseConnection extends AbstractDatabaseConnection implements java.lang.AutoCloseable
Database connection expecting input from an input stream such as stdin.- Since:
- 0.1
- Author:
- Arthur Zimek
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InputStreamDatabaseConnection.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.function.Supplier<java.io.InputStream>
in
The input stream to parse from.(package private) java.io.InputStream
ins
The stream that we are processing.private static Logging
LOG
The logger for this class.(package private) Parser
parser
Holds the instance of the parser.-
Fields inherited from class elki.datasource.AbstractDatabaseConnection
filters, LABEL_CONCATENATION
-
-
Constructor Summary
Constructors Constructor Description InputStreamDatabaseConnection(java.io.InputStream ins, java.util.List<? extends ObjectFilter> filters, Parser parser)
Constructor.InputStreamDatabaseConnection(java.util.function.Supplier<java.io.InputStream> in, java.util.List<? extends ObjectFilter> filters, Parser parser)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
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
-
-
-
-
Constructor Detail
-
InputStreamDatabaseConnection
public InputStreamDatabaseConnection(java.util.function.Supplier<java.io.InputStream> in, java.util.List<? extends ObjectFilter> filters, Parser parser)
Constructor.- Parameters:
in
- Input stream openerfilters
- Filters to useparser
- the parser to provide a database
-
InputStreamDatabaseConnection
public InputStreamDatabaseConnection(java.io.InputStream ins, java.util.List<? extends ObjectFilter> filters, Parser parser)
Constructor.- Parameters:
ins
- Input stream to processfilters
- Filters to useparser
- the parser to provide a database
-
-
Method Detail
-
loadData
public MultipleObjectsBundle loadData()
Description copied from interface:DatabaseConnection
Returns the initial data for a database.- Specified by:
loadData
in interfaceDatabaseConnection
- Returns:
- a database object bundle
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.io.IOException
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractDatabaseConnection
Get the logger for this database connection.- Specified by:
getLogger
in classAbstractDatabaseConnection
- Returns:
- Logger
-
-