Package uk.ac.starlink.table.join
Class JoinType
java.lang.Object
uk.ac.starlink.table.join.JoinType
Defines how a set of matched rows from input tables
(
RowLink
objects) are used to select rows for inclusion
in an output table which represents the result of the matching operation.
This corresponds to the type of the join in database terminology, though
the naming of the instances of this class do not follow that
terminology (left outer join etc), and the options here present a more
complete set.
Instances of this class are available as public static members of it. Currently, these instances should only be used with the results of pair matches (ones involving exactly two tables).
- Since:
- 5 Sep 2005
- Author:
- Mark Taylor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JoinType
Selects only rows with input from both input tables.static final JoinType
Selects only rows in the first input table which are not matched by any row in the second input table.static final JoinType
Selects rows with input from either or both input tables.static final JoinType
Selects only rows with input from exactly one of the two input tables.static final JoinType
Selects only rows in the second input table which are not matched by any row in the first input table.static final JoinType
Selects all output rows with input from the first input table.static final JoinType
Selects all output rows with input from the second input table. -
Method Summary
Modifier and TypeMethodDescriptionabstract String
Returns a short textual description of this type.getName()
Returns the name of this type.static JoinType[]
Returns a list of all the known types which apply to two-table matches.abstract boolean
Returns a value which indicates whether the matchScore is ever non-empty in the output table.abstract boolean[]
Returns an array of flags indicating whether each of the tables in the input will ever have non-empty rows in the output.abstract LinkSet
processLinks
(LinkSet links, int[] rowCounts) Turns a set of links which represent matches from the matching operation into a set of links which represent the rows to output.toString()
Returns the name of this type.
-
Field Details
-
_1AND2
Selects only rows with input from both input tables. -
_1OR2
Selects rows with input from either or both input tables. -
_ALL1
Selects all output rows with input from the first input table. -
_ALL2
Selects all output rows with input from the second input table. -
_2NOT1
Selects only rows in the second input table which are not matched by any row in the first input table. -
_1NOT2
Selects only rows in the first input table which are not matched by any row in the second input table. -
_1XOR2
Selects only rows with input from exactly one of the two input tables.
-
-
Method Details
-
processLinks
Turns a set of links which represent matches from the matching operation into a set of links which represent the rows to output.links
is a set ofRowLink
objects; if the matching operation was between two tables, each element will represent a pair match (have twoRowRef
s, with table indices of 0 and 1 respectively). The ordering oflinks
may influence the order of the returned collection.links
may be modified by this method, and the returned value may or may not be the same object as the inputlinks
itself.- Parameters:
links
- set of RowLinks representing actual matchesrowCounts
- numbers of rows in the tables on which the match was performed- Returns:
- set of RowLinks representing rows for the output table
-
getUsedTableFlags
public abstract boolean[] getUsedTableFlags()Returns an array of flags indicating whether each of the tables in the input will ever have non-empty rows in the output.- Returns:
- 2-element boolean array indicating whether first and second input tables appear in output
-
getUsedMatchFlag
public abstract boolean getUsedMatchFlag()Returns a value which indicates whether the matchScore is ever non-empty in the output table.- Returns:
- true iff the matchScore may be used in the output
-
getName
Returns the name of this type.- Returns:
- name
-
getDescription
Returns a short textual description of this type.- Returns:
- description
-
toString
Returns the name of this type. -
getPairTypes
Returns a list of all the known types which apply to two-table matches.- Returns:
- array of the 7 known types
-