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.
Version:
$Id: $Id
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.
      Returns:
      a ParameterPair object
    • 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)
      Checks if this ParameterPair object is equal to the specified object.
      Overrides:
      equals in class Object
      Parameters:
      object - the object to compare to this ParameterPair
      Returns:
      true if the specified object is equal to this ParameterPair, false otherwise
    • hashCode

      public int hashCode()

      hashCode.

      Overrides:
      hashCode in class Object
      Returns:
      this hashcode.