package de.lmu.ifi.dbs.wrapper;

import de.lmu.ifi.dbs.parser.Parser;
import de.lmu.ifi.dbs.parser.StandardLabelParser;
import de.lmu.ifi.dbs.database.Database;

import java.io.File;
import java.io.InputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 *
 */
public class Test {
  public static void main(String[] args) {
    try {
      File file = new File("test.txt");
      InputStream in = new FileInputStream(file);

      Parser parser = new StandardLabelParser();
      String[] param = {"-database","de.lmu.ifi.dbs.database.RTreeDatabase"};
      parser.setParameters(param);

      Database db = parser.parse(in);
      System.out.println(db);
    }
    catch (FileNotFoundException e) {
      e.printStackTrace();
    }
  }
}

@@ -26,16 +26,103 @@
 apper;%0A%0A
+import de.lmu.ifi.dbs.database.Database;%0Aimport de.lmu.ifi.dbs.database.RTreeDatabase;%0A
 import d
@@ -227,47 +227,137 @@
 bs.d
-atabase.Database;%0A%0Aimport java.io.File;
+istance.DistanceFunction;%0Aimport de.lmu.ifi.dbs.distance.EuklideanDistanceFunction;%0Aimport de.lmu.ifi.dbs.utilities.QueryResult;%0A
 %0Aimp
@@ -368,27 +368,20 @@
 java.io.
-InputStream
+File
 ;%0Aimport
@@ -443,16 +443,67 @@
 ception;
+%0Aimport java.io.InputStream;%0Aimport java.util.List;
 %0A%0A/**%0A *
@@ -595,16 +595,17 @@
 ile file
+1
  = new F
@@ -641,16 +641,17 @@
 tream in
+1
  = new F
@@ -669,20 +669,20 @@
 eam(file
+1
 );%0A
-%0A
       Pa
@@ -692,16 +692,420 @@
 r parser
+1 = new StandardLabelParser();%0A      String%5B%5D param1 = %7B%22-database%22, %22de.lmu.ifi.dbs.database.RTreeDatabase%22,%0A                         %22-%22 + RTreeDatabase.FILE_NAME_P, %22elki.idx%22%7D;%0A      parser1.setParameters(param1);%0A      Database db1 = parser1.parse(in1);%0A      System.out.println(db1);%0A%0A      File file2 = new File(%22test.txt%22);%0A      InputStream in2 = new FileInputStream(file2);%0A      Parser parser2
  = new S
@@ -1146,16 +1146,17 @@
 %5B%5D param
+2
  = %7B%22-da
@@ -1163,16 +1163,17 @@
 tabase%22,
+ 
 %22de.lmu.
@@ -1218,16 +1218,17 @@
   parser
+2
 .setPara
@@ -1239,20 +1239,20 @@
 rs(param
+2
 );%0A
-%0A
       Da
@@ -1260,16 +1260,17 @@
 abase db
+2
  = parse
@@ -1270,16 +1270,17 @@
 = parser
+2
 .parse(i
@@ -1280,16 +1280,17 @@
 parse(in
+2
 );%0A     
@@ -1311,18 +1311,546 @@
 intln(db
+2
 );
+%0A%0A      DistanceFunction distFunction = new EuklideanDistanceFunction();%0A      List%3CQueryResult%3E r1 = db1.kNNQuery(new Integer(Integer.MIN_VALUE + 300), 10, distFunction);%0A      System.out.println(%22r1 %22+r1);%0A%0A      List%3CQueryResult%3E r2 = db2.kNNQuery(new Integer(Integer.MIN_VALUE +300), 10, distFunction);%0A      System.out.println(%22r2 %22+r2);%0A%0A//      for (int i = 0; i %3C 450; i++) %7B%0A//        MetricalObject o = db1.get(new Integer(Integer.MIN_VALUE + i));%0A//        db1.delete(o);%0A//        System.out.println(db1);%0A//      %7D
 %0A    %7D%0A 

test cases for RTree