Class TypePairComparator<T1,T2>
- java.lang.Object
-
- org.apache.flink.api.common.typeutils.TypePairComparator<T1,T2>
-
- Type Parameters:
T1
- The class of the first data type.T2
- The class of the second data type.
- Direct Known Subclasses:
GenericPairComparator
,SameTypePairComparator
@Internal public abstract class TypePairComparator<T1,T2> extends Object
This interface defines the method required by the runtime to use data types in join-like operations. In such operations, instances of different data types are compared for equality with respect to certain attributes, such as join keys.The class compares instances of two different data types. One is always used as the reference data type, and the other is checked against the reference. An instance of the reference data type is normally set as the reference for comparisons. Afterwards one or more instances of the other data type are checked against the reference.
-
-
Constructor Summary
Constructors Constructor Description TypePairComparator()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract int
compareToReference(T2 candidate)
abstract boolean
equalToReference(T2 candidate)
Checks, whether the given candidate instance is equal to the reference instance, with respect to this comparator's equality definition.abstract void
setReference(T1 reference)
Sets the reference for comparisons.
-
-
-
Method Detail
-
setReference
public abstract void setReference(T1 reference)
Sets the reference for comparisons.- Parameters:
reference
- The reference instance.
-
equalToReference
public abstract boolean equalToReference(T2 candidate)
Checks, whether the given candidate instance is equal to the reference instance, with respect to this comparator's equality definition.- Parameters:
candidate
- The candidate to check.- Returns:
- True, if the candidate is equal to the reference, false otherwise.
-
compareToReference
public abstract int compareToReference(T2 candidate)
-
-