Package uk.ac.starlink.table.join

# Class Match1Type

java.lang.Object
uk.ac.starlink.table.join.Match1Type

public abstract class Match1Type extends Object
Defines how an output table is created from the results of an internal (single-table) match operation. This class contains several factory methods for generating sensible output tables from an internal match. Others are possible.

Basic use of this class looks something like:

         LinkSet linkSet = type.processLinks(RowMatcher.findInternalMatches());
         StarTable table = createMatchTable(inTable, linkSet.toSorted());

(the sorting is optional).

Since:
  15 Nov 2007
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`Match1Type()`

## Method Summary

Modifier and Type
Method
Description
`static Match1Type`
`createEliminateMatchesType(int retainCount)`
Factory method returning a type object which eliminates rows forming part of the same match group.
`static Match1Type`
`createIdentifyType()`
Factory method returning a type object which identifies matched rows by adding some additional columns to the input.
`abstract uk.ac.starlink.table.StarTable`
`createMatchTable(uk.ac.starlink.table.StarTable inTable, Collection<RowLink> rowLinks)`
Generates an output table given an input table and the RowLink sequence which defines how its rows are related to each other by matching.
`static Match1Type`
`createWideType(int grpSize)`
Factory method returning a type object which aligns match groups with each other in the rows of a new wide table.
`abstract LinkSet`
`processLinks(LinkSet rowLinks)`
Performs additional processing specific to this match type on the raw LinkSet produced by {RowMatcher#findInternalMatches}.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Match1Type

public Match1Type()

## Method Details

### processLinks

public abstract LinkSet processLinks(LinkSet rowLinks)
Performs additional processing specific to this match type on the raw LinkSet produced by {RowMatcher#findInternalMatches}. The input linkset may be modified, and the output value may or may not be the same instance as the input.

Parameters:
  `rowLinks` - link set representing a single-table (internal) match
Returns:
  link set ready for table creation

### createMatchTable

public abstract uk.ac.starlink.table.StarTable createMatchTable(uk.ac.starlink.table.StarTable inTable, Collection<RowLink> rowLinks)
Generates an output table given an input table and the RowLink sequence which defines how its rows are related to each other by matching.

Parameters:
  `inTable` - input table
  `rowLinks` - links resulting from a call to `processLinks(uk.ac.starlink.table.join.LinkSet)`

### createIdentifyType

public static Match1Type createIdentifyType()
Factory method returning a type object which identifies matched rows by adding some additional columns to the input. These flag which rows match which other ones and give a group size count.

Returns:
  new identification type

### createEliminateMatchesType

public static Match1Type createEliminateMatchesType(int retainCount)
Factory method returning a type object which eliminates rows forming part of the same match group. All rows from a match group starting at index `retainCount` are removed from the output table. Thus `retainCount=0` removes any rows which participate in matches with other ones, and `retainCount=1` leaves just one from any such group.

Parameters:
  `retainCount` - number of items to retain from each match group

### createWideType

public static Match1Type createWideType(int grpSize)
Factory method returning a type object which aligns match groups with each other in the rows of a new wide table. The output table has columns like `grpSize` versions of the input table side by side, and where there are exactly `grpSize` matches in a group they form a row. Rows which are not part of a `grpSize`-element match do not appear in the output.

Parameters:
  `grpSize` - size of group we are interested in