Package no.priv.garshol.duke

Examples of no.priv.garshol.duke.Record


        {"http://a/2", "George", "151"}});

    RecordIterator it = source.getRecords();
    assertTrue("data source contains no records", it.hasNext());

    Record r = it.next();
    assertEquals("wrong ID", "http://a/1", r.getValue("ID"));
    assertEquals("wrong NAME", "Peter", r.getValue("NAME"));
    assertEquals("wrong AGE", "15", r.getValue("AGE"));

    assertTrue("data source contains only one record", it.hasNext());

    r = it.next();
    assertEquals("wrong ID", "http://a/2", r.getValue("ID"));
    assertEquals("wrong NAME", "George", r.getValue("NAME"));
    assertEquals("wrong AGE", "151", r.getValue("AGE"));   

    assertFalse("data source contains more than two records", it.hasNext());
    assertEquals("wrong number of pages", 3, source.getPages());
  }
View Full Code Here


        {"http://a/3", "Fluffy", "25151"}});

    RecordIterator it = source.getRecords();
    assertTrue("data source contains no records", it.hasNext());

    Record r = it.next();
    assertEquals("wrong ID", "http://a/1", r.getValue("ID"));
    assertEquals("wrong NAME", "Peter", r.getValue("NAME"));
    assertEquals("wrong AGE", "15", r.getValue("AGE"));

    assertTrue("data source contains only one record", it.hasNext());

    r = it.next();
    assertEquals("wrong ID", "http://a/2", r.getValue("ID"));
    assertEquals("wrong NAME", "George", r.getValue("NAME"));
    assertEquals("wrong AGE", "151", r.getValue("AGE"));   

    assertTrue("data source contains only two records", it.hasNext());

    r = it.next();
    assertEquals("wrong ID", "http://a/3", r.getValue("ID"));
    assertEquals("wrong NAME", "Fluffy", r.getValue("NAME"));
    assertEquals("wrong AGE", "25151", r.getValue("AGE"));   
   
    assertFalse("data source contains more than three records", it.hasNext());
    assertEquals("wrong number of pages", pages, source.getPages());
  }
View Full Code Here

    public boolean hasNext() {
      return nextrecord != null;
    }
   
    public Record next() {
      Record record = nextrecord;
      findNextRecord();
      return record;
    }
View Full Code Here

      // when asking questions about them
      secondary = new HashMap();
      for (DataSource src : config.getDataSources(2)) {
        RecordIterator it = src.getRecords();
        while (it.hasNext()) {
          Record r = it.next();
          secondary.put(getid(r), r);
        }
      }
    }
View Full Code Here

    Filter f = new Filter(tracker.getExemplars());
    while (true) {
      Pair pair = f.getNext();
      if (pair == null)
        break;
      Record r1 = database.findRecordById(pair.id1);
      if (r1 == null)
        r1 = secondary.get(pair.id1);
      Record r2 = database.findRecordById(pair.id2);

      System.out.println();
      PrintMatchListener.prettyCompare(r1, r2, (double) pair.counter,
                                       "Possible match",
                                       config.getProperties());
View Full Code Here

      }
      return ((double) intersection) / ((double) union);
    }

    private boolean[] whoThinksThisIsTrue(String id1, String id2) {
      Record r1 = database.findRecordById(id1);
      if (r1 == null)
        r1 = secondary.get(id1);
      Record r2 = database.findRecordById(id2);
      if (r2 == null)
        r2 = secondary.get(id2);

      List<GeneticConfiguration> configs = population.getConfigs();
      boolean[] believers = new boolean[configs.size()];
View Full Code Here

    public boolean hasNext() {
      return (nextrecord != null);
    }

    public Record next() {
      Record thenext = nextrecord;
      findNextRecord();
      return thenext;
    }
View Full Code Here

   
    public Record next() {
      if (next == null)
        return it.next(); // will throw exception

      Record tmp = next;
      findNext();
      return tmp;
    }
View Full Code Here

    source.addColumn(c);
    source.addColumn(new Column("F3", null, null, null));

    RecordIterator it = read("F1,F2,F3\na, b ; d ; e ,c");

    Record r = it.next();
    assertEquals("a", r.getValue("F1"));
    assertEquals("c", r.getValue("F3"));

    Collection<String> values = r.getValues("F2");
    assertEquals(3, values.size());
    assertTrue(values.contains("b"));
    assertTrue(values.contains("d"));
    assertTrue(values.contains("e"));
  }
View Full Code Here

    source.addColumn(new Column("F2", null, null, null));
    source.addColumn(new Column("F3", null, null, null));

    RecordIterator it = read("F1,F2,F3\na,b,");

    Record r = it.next();
    assertEquals("a", r.getValue("F1"));
    assertEquals("b", r.getValue("F2"));
    assertEquals(r.getValue("F3"), null);
  }
View Full Code Here

TOP

Related Classes of no.priv.garshol.duke.Record

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.