예제 #1
0
  public void testResolveConflictCollectionOfFusableValueOfDoubleRecordType2() {

    Average<FusableMovie> crf = new Average<FusableMovie>();
    List<FusableValue<Double, FusableMovie>> cluster2 =
        new ArrayList<FusableValue<Double, FusableMovie>>();
    FusedValue<Double, FusableMovie> resolvedValue = crf.resolveConflict(cluster2);
    assertEquals(null, resolvedValue.getValue());
  }
예제 #2
0
  public void testResolveConflictCollectionOfFusableValueOfDoubleRecordType() {

    Average<FusableMovie> crf = new Average<FusableMovie>();
    List<FusableValue<Double, FusableMovie>> cluster1 =
        new ArrayList<FusableValue<Double, FusableMovie>>();
    cluster1.add(new FusableValue<Double, FusableMovie>(1.0, null, null));
    cluster1.add(new FusableValue<Double, FusableMovie>(2.0, null, null));
    cluster1.add(new FusableValue<Double, FusableMovie>(3.0, null, null));
    FusedValue<Double, FusableMovie> resolvedValue = crf.resolveConflict(cluster1);
    assertEquals(2.0, resolvedValue.getValue());
  }
예제 #3
0
  @Override
  public void fuse(RecordGroup<FusableCompany> group, FusableCompany fusedRecord) {

    // get the fused value
    FusedValue<String, FusableCompany> fused = getFusedValue(group);

    // set the value for the fused record
    fusedRecord.setName(fused.getValue());

    // add provenance info
    fusedRecord.setAttributeProvenance(FusableCompany.NAME, fused.getOriginalIds());
  }
  @Override
  public void fuse(RecordGroup<FusableCountry> group, FusableCountry fusedRecord) {

    // get the fused value
    FusedValue<String, FusableCountry> fused = getFusedValue(group);

    // set the value for the fused record
    fusedRecord.setCode(fused.getValue());

    // add provenance info
    //		System.out.println("Provenance Code: " + fused.getOriginalIds());
    fusedRecord.setAttributeProvenance(FusableCountry.CODE, fused.getOriginalIds());
  }