Package uk.ac.starlink.table.join
Class Match1Type
java.lang.Object
uk.ac.starlink.table.join.Match1Type
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic Match1TypecreateEliminateMatchesType(int retainCount) Factory method returning a type object which eliminates rows forming part of the same match group.static Match1TypeFactory method returning a type object which identifies matched rows by adding some additional columns to the input.abstract uk.ac.starlink.table.StarTablecreateMatchTable(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 Match1TypecreateWideType(int grpSize) Factory method returning a type object which aligns match groups with each other in the rows of a new wide table.abstract LinkSetprocessLinks(LinkSet rowLinks) Performs additional processing specific to this match type on the raw LinkSet produced by {RowMatcher#findInternalMatches}.
-
Constructor Details
-
Match1Type
public Match1Type()
-
-
Method Details
-
processLinks
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 tablerowLinks- links resulting from a call toprocessLinks(uk.ac.starlink.table.join.LinkSet)
-
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
Factory method returning a type object which eliminates rows forming part of the same match group. All rows from a match group starting at indexretainCountare removed from the output table. ThusretainCount=0removes any rows which participate in matches with other ones, andretainCount=1leaves just one from any such group.- Parameters:
retainCount- number of items to retain from each match group
-
createWideType
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 likegrpSizeversions of the input table side by side, and where there are exactlygrpSizematches 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
-