protected <T>Database makeSimpleDatabase(String filename,int expectedSize,ListParameterization params,Class<?>[] filters){
  try (InputStream is=open(filename)){
    List<ObjectFilter> filterlist=new ArrayList<>();
    filterlist.add(new FixedDBIDsFilter(1));
    if (filters != null) {
      for (      Class<?> filtercls : filters) {
        ObjectFilter filter=ClassGenericsUtil.parameterizeOrAbort(filtercls,params);
        filterlist.add(filter);
      }
    }
    NumberVectorLabelParser<DoubleVector> parser=new NumberVectorLabelParser<>(DoubleVector.FACTORY);
    InputStreamDatabaseConnection dbc=new InputStreamDatabaseConnection(is,filterlist,parser);
    params.addParameter(AbstractDatabase.Parameterizer.DATABASE_CONNECTION_ID,dbc);
    Database db=ClassGenericsUtil.parameterizeOrAbort(StaticArrayDatabase.class,params);
    testParameterizationOk(params);
    db.initialize();
    Relation<?> rel=db.getRelation(TypeUtil.ANY);
    assertEquals("Database size does not match.",expectedSize,rel.size());
    return db;
  }
 catch (  IOException e) {
    fail("Test data " + filename + " not found.");
    return null;
  }
}

protected < T > Database makeSimpleDatabase ( String filename , int expectedSize , ListParameterization params , Class < ? > [ ] filters ) { try ( InputStream is = open ( filename ) ) { List < ObjectFilter > filterlist = new ArrayList < > ( ) ; filterlist . add ( new FixedDBIDsFilter ( 1 ) ) ; if ( filters != null ) { for ( Class < ? > filtercls : filters ) { ObjectFilter filter = ClassGenericsUtil . parameterizeOrAbort ( filtercls , params ) ; filterlist . add ( filter ) ; } } NumberVectorLabelParser < DoubleVector > parser = new NumberVectorLabelParser < > ( DoubleVector . FACTORY ) ; InputStreamDatabaseConnection dbc = new InputStreamDatabaseConnection ( is , filterlist , parser ) ; params . addParameter ( AbstractDatabase . Parameterizer . DATABASE_CONNECTION_ID , dbc ) ; Database db = ClassGenericsUtil . parameterizeOrAbort ( StaticArrayDatabase . class , params ) ; testParameterizationOk ( params ) ; db . initialize ( ) ; Relation < ? > rel = db . getRelation ( TypeUtil . ANY ) ; assertEquals ( "Database size does not match." , expectedSize , rel . size ( ) ) ; return db ; } catch ( IOException e ) { fail ( "Test data " + filename + " not found." ) ; return null ; } }
generate a simple doublevector database from a file .
