Class ParameterPair

java.lang.Object
edu.cmu.tetrad.sem.ParameterPair
All Implemented Interfaces:
TetradSerializable, Serializable

public class ParameterPair extends Object implements TetradSerializable
Implements an ordered pair of objects (a, b) suitable for storing in HashSets. The hashCode() method is overridden so that the hashcode of (a1, b1) == the hashcode of (a2, b2) just in case a1 == a2 and b1 == b2.
Author:
josephramsey
See Also:
  • Constructor Details

    • ParameterPair

      public ParameterPair(Parameter a, Parameter b)
      Constructs a new ordered pair (a, b).
      Parameters:
      a - the first element of the ordered pair.
      b - the second element of the ordered pair.
  • Method Details

    • serializableInstance

      public static ParameterPair serializableInstance()
      Generates a simple exemplar of this class to test serialization.
    • getA

      public Parameter getA()
      Method getNumObjects
      Returns:
      the first element of the ordered pair.
    • getB

      public Parameter getB()
      Method getNumObjects
      Returns:
      the second element of the ordered pair.
    • equals

      public boolean equals(Object object)
      Tests whether this object pair is equal to a second object pair by looking to see whether each element a and b is equal to its corresponding element.
      Overrides:
      equals in class Object
      Parameters:
      object - the object pair putatively equal to this one.
      Returns:
      true if the object pairs are equals, false if not.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      this hashcode.