Sorry for the naive question, but I got stuck while following all the pieces of tutorials available. So, is there a way to populate a Database db from a simple List rather than loading it reading a file?
Basically what I'm looking for is something similar to:
List objects = ...
Database db = ClassGenericsUtil.parameterizeOrAbort(ArrayDatabase.class, params, objects);
db.initialize();
Thanks in advance.
What are the contents of your
String
s? Same as understood by the ELKI parsers?This will likely require some code modifications, because the parsers are designed around Javas
InputStream
. I don't suggest wrapping aList<String>
into anInputStream
although that would probably be the least-effort approach.Why don't you try extending
AbstractDatabaseConnection
(or implementingDatabaseConnection
)? The database connection format,MultipleObjectsBundle
is not much more thanList<Object>
and relation metadata; fairly easy to construct.Alternatively, you could use your own code to parse the
String
s intodouble[]
and then useArrayAdapterDatabaseConnection
; which will wrap thedouble[]
asDoubleVector
for you and construct the bundles.