serf.data
Class SimpleMatcherMerger

java.lang.Object
  extended by serf.data.SimpleMatcherMerger
All Implemented Interfaces:
MatcherMerger
Direct Known Subclasses:
MatchMergeIgnoreConf

public class SimpleMatcherMerger
extends java.lang.Object
implements MatcherMerger


Constructor Summary
SimpleMatcherMerger(RecordFactory factory, int k)
          This creates a SimpleMatcherMerger that checks for proximity within k, but doesn't look for wraparound around a particular domain.
SimpleMatcherMerger(RecordFactory factory, int d, int k)
           
 
Method Summary
 long getMatchCount()
           
 long getMergeCount()
           
 boolean match(Record r1, Record r2)
          Compare records.
 Record merge(Record r1, Record r2)
          Merge two records into a single record.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMatcherMerger

public SimpleMatcherMerger(RecordFactory factory,
                           int k)
This creates a SimpleMatcherMerger that checks for proximity within k, but doesn't look for wraparound around a particular domain.

Parameters:
factory -
k -

SimpleMatcherMerger

public SimpleMatcherMerger(RecordFactory factory,
                           int d,
                           int k)
Parameters:
factory -
d - - the domain of possible values [1, domain]. Wraparounds will be detected and considered matches.
k - - the width of the matching range. if k == 1, then only exact matches count. if k == 2 then 0 matches with -1, 0, and 1.
Method Detail

match

public boolean match(Record r1,
                     Record r2)
Description copied from interface: MatcherMerger
Compare records. If they match, return true.

Specified by:
match in interface MatcherMerger
Parameters:
r1 - Record 1
r2 - Record 2
Returns:
true if the records match.

merge

public Record merge(Record r1,
                    Record r2)
Description copied from interface: MatcherMerger
Merge two records into a single record. Return the merged record

Specified by:
merge in interface MatcherMerger
Parameters:
r1 - Record 1
r2 - Record 2
Returns:
the record resulting from merging Records 1 and 2.

getMatchCount

public long getMatchCount()

getMergeCount

public long getMergeCount()