uk.ac.starlink.table.join
Class EqualsMatchEngine

java.lang.Object
  |
  +--uk.ac.starlink.table.join.EqualsMatchEngine
All Implemented Interfaces:
MatchEngine

public class EqualsMatchEngine
extends Object
implements MatchEngine

Match engine which considers two rows matched if they contain objects which are non-null and equal (in the sense of Object.equals(java.lang.Object)). These will typically be strings, but could equally be something else.

Since:
25 Mar 2004

Constructor Summary
EqualsMatchEngine()
           
 
Method Summary
 Object[] getBins(Object[] tuple)
          Returns a set of keys for bins into which possible matches for a given tuple might fall.
 DescribedValue[] getMatchParameters()
          Returns a set of DescribedValue objects whose values can be modified to modify the matching criteria.
 ValueInfo[] getTupleInfos()
          Returns a set of ValueInfo objects indicating what is required for the elements of each tuple.
 boolean matches(Object[] tuple1, Object[] tuple2)
          Indicates whether two tuples are to be linked.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EqualsMatchEngine

public EqualsMatchEngine()
Method Detail

matches

public boolean matches(Object[] tuple1,
                       Object[] tuple2)
Description copied from interface: MatchEngine
Indicates whether two tuples are to be linked.

Specified by:
matches in interface MatchEngine
Parameters:
tuple1 - one tuple
tuple2 - the other tuple
Returns:
true iff tuple1 should be considered a match for tuple2

getBins

public Object[] getBins(Object[] tuple)
Description copied from interface: MatchEngine
Returns a set of keys for bins into which possible matches for a given tuple might fall. The returned objects can be anything, but should have their equals and hashCode methods implemented properly for comparison.

Specified by:
getBins in interface MatchEngine
Parameters:
tuple -
Returns:
set of bin keys which might be returned by invoking this method on other tuples which count as matches for the submitted tuple

getTupleInfos

public ValueInfo[] getTupleInfos()
Description copied from interface: MatchEngine
Returns a set of ValueInfo objects indicating what is required for the elements of each tuple. The length of this array is the number of elements in the tuple. Each element should at least have a defined name and content class. The info's nullable attribute has a special meaning: if true it means that it makes sense for this element of the tuple to be always blank (for instance assigned to no column).

Specified by:
getTupleInfos in interface MatchEngine
Returns:
array of objects describing the requirements on each element of the tuples used for matching

getMatchParameters

public DescribedValue[] getMatchParameters()
Description copied from interface: MatchEngine
Returns a set of DescribedValue objects whose values can be modified to modify the matching criteria. Typically at least one of these will be some sort of tolerance separation which determines how close tuples must be to count as a match. This match engine's behaviour can be modified by calling DescribedValue.setValue(java.lang.Object) on the returned objects.

Specified by:
getMatchParameters in interface MatchEngine
Returns:
array of described values which influence the match

toString

public String toString()
Overrides:
toString in class Object

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.