Class 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.
    • Constructor Summary

      Constructors 
      Constructor Description
      InputPair()
      Creates a blank input pair.
      InputPair​(int record_key_1, int record_key_2, float score)
      Creates an input pair with the specified values.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(InputPair other)
      Compares the scores of the two pairs.
      boolean isSelfMatch()
      Checks if the pair is a self-match (the record keys are identical).
      int otherKey​(int record_key)
      Given one key of the pair, retrieves the other key of the pair.
      java.lang.String toString()
      Creates a string description of the pair.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • record_key_1

        public int record_key_1
      • record_key_2

        public int record_key_2
      • score

        public float score
    • 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:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(InputPair other)
        Compares the scores of the two pairs.
        Specified by:
        compareTo in interface java.lang.Comparable<InputPair>
      • otherKey

        public final int otherKey​(int record_key)
                           throws GroupingException
        Given 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.