Package uk.ac.starlink.table.join
Class Match1Type
- java.lang.Object
-
- uk.ac.starlink.table.join.Match1Type
-
public abstract class Match1Type extends java.lang.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
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 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, java.util.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}.
-
-
-
Method Detail
-
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, java.util.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 tablerowLinks
- links resulting from a call toprocessLinks(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 indexretainCount
are removed from the output table. ThusretainCount=0
removes any rows which participate in matches with other ones, andretainCount=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 likegrpSize
versions of the input table side by side, and where there are exactlygrpSize
matches in a group they form a row. Rows which are not part of agrpSize
-element match do not appear in the output.- Parameters:
grpSize
- size of group we are interested in
-
-