uk.ac.starlink.table.join
Class BinContents

java.lang.Object
  |
  +--uk.ac.starlink.table.join.BinContents

public class BinContents
extends Object

Describes the contents of all the bins used in a matching operation. This is basically a mapping from bin id (one of the objects returned from a MatchEngine.getBins(java.lang.Object[]) call) to a list of rows.

The way you would normally use it is for each row you are interested in, call MatchEngine.getBins(java.lang.Object[]), and then associate it with each of the returned bins by calling putRowInBin(java.lang.Object, uk.ac.starlink.table.join.RowRef) on this object. When you're done, you can call addRowLinks(uk.ac.starlink.table.join.LinkSet) to find all the distinct sets of rows that appear as bin contents. Because of the declared semantics of the getBins call, what this gives you is a list of all the groups of rows which might be mutually matching according to the MatchEngine.matchScore(java.lang.Object[], java.lang.Object[]) method.

Since:
6 Aug 2004

Constructor Summary
BinContents(ProgressIndicator indicator)
          Constructs a new BinContents object.
 
Method Summary
 void addRowLinks(LinkSet links)
          Calculates a set of RowLink objects which represent all the distinct groups of RowRefs associated with any of the bins, and adds them to a given Set object.
 boolean containsKey(Object key)
          Indicates whether the given key exists in this map; that is whether any rows have yet been associated with it.
 void putRowInBin(Object key, RowRef row)
          Associates a row with a bin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinContents

public BinContents(ProgressIndicator indicator)
Constructs a new BinContents object.

Parameters:
indicator - progress indicator to use for logging time-consuming operations
Method Detail

putRowInBin

public void putRowInBin(Object key,
                        RowRef row)
Associates a row with a bin.

Parameters:
key - bin ID
row - row reference

containsKey

public boolean containsKey(Object key)
Indicates whether the given key exists in this map; that is whether any rows have yet been associated with it.

Parameters:
key - bin ID
Returns:
true iff putRowInBin(key,...) has yet been called

addRowLinks

public void addRowLinks(LinkSet links)
                 throws InterruptedException
Calculates a set of RowLink objects which represent all the distinct groups of RowRefs associated with any of the bins, and adds them to a given Set object. Only RowLinks containing more than one entry are put in the resulting set, since the others aren't interesting.

Note that this method will (for memory efficiency purposes) clear out the map; following a call to this method this object is effectively empty of any data.

Parameters:
links - set to which links will be added
InterruptedException

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