Class GraphNode

  • All Implemented Interfaces:
    GraphConstants

    public class GraphNode
    extends java.lang.Object
    implements GraphConstants
    This class represents a node in the Graph.
    Version:
    $Revision: 8034 $ - 23 Apr 2003 - Initial version (Ashraf M. Kibriya)
    Author:
    Ashraf M. Kibriya (amk14@cs.waikato.ac.nz)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int[][] edges
      The indices of nodes to which there are edges from this node, plus the type of edge
      java.lang.String ID
      ID and label for the node
      java.lang.String lbl
      ID and label for the node
      int nodeType
      Type of node.
      java.lang.String[] outcomes
      The outcomes for the given node
      int[] prnts
      The indices of parent nodes
      double[][] probs
      probability table for each outcome given outcomes of parents, if any
      int x
      The x and y position of the node
      int y
      The x and y position of the node
    • Constructor Summary

      Constructors 
      Constructor Description
      GraphNode​(java.lang.String id, java.lang.String label)
      Constructor
      GraphNode​(java.lang.String id, java.lang.String label, int type)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object n)
      Returns true if passed in argument is an instance of GraphNode and is equal to this node.
      • Methods inherited from class java.lang.Object

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

      • ID

        public java.lang.String ID
        ID and label for the node
      • lbl

        public java.lang.String lbl
        ID and label for the node
      • outcomes

        public java.lang.String[] outcomes
        The outcomes for the given node
      • probs

        public double[][] probs
        probability table for each outcome given outcomes of parents, if any
      • x

        public int x
        The x and y position of the node
      • y

        public int y
        The x and y position of the node
      • prnts

        public int[] prnts
        The indices of parent nodes
      • edges

        public int[][] edges
        The indices of nodes to which there are edges from this node, plus the type of edge
      • nodeType

        public int nodeType
        Type of node. Default is Normal node type
    • Constructor Detail

      • GraphNode

        public GraphNode​(java.lang.String id,
                         java.lang.String label)
        Constructor
      • GraphNode

        public GraphNode​(java.lang.String id,
                         java.lang.String label,
                         int type)
        Constructor
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object n)
        Returns true if passed in argument is an instance of GraphNode and is equal to this node. Implemented to enable the use of contains method in Vector/FastVector class.
        Overrides:
        equals in class java.lang.Object