Class KnowledgeEdge

java.lang.Object
edu.cmu.tetrad.data.KnowledgeEdge
All Implemented Interfaces:
TetradSerializable, Serializable

public final class KnowledgeEdge extends Object implements TetradSerializable
Implements a knowledge edge X-->Y as a simple ordered pair of strings.
Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Details

    • KnowledgeEdge

      public KnowledgeEdge(String from, String to)
      Constructs a knowledge edge for from-->to.
      Parameters:
      from - a String object
      to - a String object
  • Method Details

    • serializableInstance

      public static KnowledgeEdge serializableInstance()
      Generates a simple exemplar of this class to test serialization.
      Returns:
      a KnowledgeEdge object
    • getFrom

      public String getFrom()

      Getter for the field from.

      Returns:
      the tail node of the edge.
    • getTo

      public String getTo()

      Getter for the field to.

      Returns:
      the head node of the edge.
    • equals

      public boolean equals(Object object)

      Reteurns true if (from1, to1) == (from2, to2).

      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()

      hashCode.

      Overrides:
      hashCode in class Object
      Returns:
      a good hashcode.
    • toString

      public String toString()

      toString.

      Overrides:
      toString in class Object
      Returns:
      a String object