|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the details of object matching criteria.
This interface provides methods for ascertaining whether two table
rows are to be linked - this usually means that they are to be
assumed to refer to the same object.
The methods act on 'tuples' - an array of objects defining the relevant
characteristics of a row. Of course these tuples have to be prepared
with understanding of what a particular implementation of this interface
knows how to deal with, which can be obtained from the getTupleInfos()
method. Typically a tuple will be a list of coordinates,
such as RA and Dec.
The business end of the interface consists of two methods. One tests whether two tuples count as matching or not, and assigns a closeness score if they are (in practice, this is likely to compare corresponding elements of the two submitted tuples allowing for some error in each one). The second is a bit more subtle: it must identify a set of bins into which possible matches for the tuple might fall. For the case of coordinate matching with errors, you would need to chop the whole possible space into a discrete set of zones, each with a given key, and return the key for each zone near enough to the submitted tuple (point) that it might contain a match for it.
Formally, the requirements for correct implementations of this interface are as follows:
It may help to think of all this as a sort of fuzzy hash.
Field Summary | |
static Object[] |
NO_BINS
Convenience constant - it's a zero-length array of objects, suitable for returning from getBins(java.lang.Object[]) if no match can result. |
Method Summary | |
boolean |
canBoundMatch()
Indicates that the getMatchBounds(java.lang.Comparable[], java.lang.Comparable[]) method can be invoked
to provide some sort of useful result. |
Object[] |
getBins(Object[] tuple)
Returns a set of keys for bins into which possible matches for a given tuple might fall. |
Comparable[][] |
getMatchBounds(Comparable[] minTuple,
Comparable[] maxTuple)
Given a range of tuple values, returns a range outside which no match to anything within that range can result. |
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. |
double |
matchScore(Object[] tuple1,
Object[] tuple2)
Indicates whether two tuples count as matching each other, and if so how closely. |
Field Detail |
public static final Object[] NO_BINS
getBins(java.lang.Object[])
if no match can result.
Method Detail |
public Object[] getBins(Object[] tuple)
tuple
- tuple
public double matchScore(Object[] tuple1, Object[] tuple2)
If there's no reason to do otherwise, the range 0..1 is recommended for successul matches. However, if the result has some sort of physical meaning (such as a distance in real space) that may be used instead.
tuple1
- one tupletuple2
- the other tuple
public ValueInfo[] getTupleInfos()
public DescribedValue[] getMatchParameters()
DescribedValue.setValue(java.lang.Object)
on the
returned objects.
public Comparable[][] getMatchBounds(Comparable[] minTuple, Comparable[] maxTuple)
Both the input and output rectangles are specified by tuples representing its opposite corners; equivalently, they are the minimum and maximum values of each tuple element. In either the input or output min/max tuples, any element may be null to indicate that no information is available on the bounds of that tuple element (coordinate).
This method can be used by match algorithms which know in advance the range of coordinates they will match against and wish to reduce workload by not attempting matches which are bound to fail.
For example, a 1-d Cartesian match engine with an isotropic match error 0.5 would turn input values of ((0,200),(10,210)) into output values ((-0.5,199.5),(10.5,210.5)).
This method will only be called if canBoundMatch()
returns true. Thus engines that cannot provide any useful
information along these lines (for instance because none of its
tuple elements is Comparable
do not need to
implement it in a meaningful way.
minTuple
- tuple consisting of the minimum values of each
tuple element in a possible match
(to put it another way - coordinates of one corner of a
tuple-space rectangle containing such a match)maxTuple
- tuple consisting of the maximum values of each
tuple element in a possible match
(to put it another way - coordinates of the other corner of a
tuple-space rectangle containing such a match)
canBoundMatch()
public boolean canBoundMatch()
getMatchBounds(java.lang.Comparable[], java.lang.Comparable[])
method can be invoked
to provide some sort of useful result.
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |