Package com.tibco.patterns.grouping
Class InputPair
- java.lang.Object
-
- com.tibco.patterns.grouping.InputPair
-
- All Implemented Interfaces:
java.lang.Comparable<InputPair>
- Direct Known Subclasses:
KeyedInputPair
public class InputPair extends java.lang.Object implements java.lang.Comparable<InputPair>
Base class for pairs streamed into the grouping engine.
-
-
Field Summary
Fields Modifier and Type Field Description intrecord_key_1intrecord_key_2floatscore
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(InputPair other)Compares the scores of the two pairs.booleanisSelfMatch()Checks if the pair is a self-match (the record keys are identical).intotherKey(int record_key)Given one key of the pair, retrieves the other key of the pair.java.lang.StringtoString()Creates a string description of the pair.
-
-
-
Constructor Detail
-
InputPair
public InputPair()
Creates a blank input pair.
-
InputPair
public InputPair(int record_key_1, int record_key_2, float score)Creates an input pair with the specified values.- Parameters:
record_key_1- key of the first record of the pair.record_key_2- key of the second record of the pair.score- match score of the pair.
-
-
Method Detail
-
toString
public java.lang.String toString()
Creates a string description of the pair. Be careful overriding this, as it is used in building exception descriptions.- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(InputPair other)
Compares the scores of the two pairs.- Specified by:
compareToin interfacejava.lang.Comparable<InputPair>
-
otherKey
public final int otherKey(int record_key) throws GroupingExceptionGiven one key of the pair, retrieves the other key of the pair.- Parameters:
record_key- one of the keys of the pair.- Returns:
- the other key of the pair.
- Throws:
GroupingException- if the key given is not one of the pair keys.
-
isSelfMatch
public final boolean isSelfMatch()
Checks if the pair is a self-match (the record keys are identical).- Returns:
- true if the pair is a self-match.
-
-