Interface Node

All Superinterfaces:
Comparable<Node>, Serializable, TetradSerializable
All Known Subinterfaces:
Variable
All Known Implementing Classes:
AbstractVariable, ContinuousVariable, DiscreteVariable, GraphNode, SessionNode

public interface Node extends TetradSerializable, Comparable<Node>
Represents an object with a name, node type, and position that can serve as a node in a graph.
Author:
josephramsey
See Also:
  • Field Details

  • Method Details

    • getName

      String getName()
      Returns the name of this node.
      Returns:
      the name of the node.
    • setName

      void setName(String name)
      Sets the name of this node.
      Parameters:
      name - the name of this node.
    • getNodeType

      NodeType getNodeType()
      Returns the node type for this node.
      Returns:
      the node type for this node.
    • setNodeType

      void setNodeType(NodeType nodeType)
      Sets the node type for this node.
      Parameters:
      nodeType - the node type for this node.
    • getNodeVariableType

      NodeVariableType getNodeVariableType()
      Returns the node shape for this node.
      Returns:
      the intervention type
    • setNodeVariableType

      void setNodeVariableType(NodeVariableType nodeVariableType)
      Sets the type (domain, interventional status, interventional value..) for this node variable
      Parameters:
      nodeVariableType - the type (domain, interventional status, interventional value..) for this node variable
    • toString

      String toString()
      Returns the intervention type for this node.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the node.
    • getCenterX

      int getCenterX()
      Returns the x coordinate of the center of this node.
      Returns:
      the x coordinate of the center of the node.
    • setCenterX

      void setCenterX(int centerX)
      Sets the x coordinate of the center of this node.
      Parameters:
      centerX - This coordinate.
    • getCenterY

      int getCenterY()
      Returns the y coordinate of the center of this node.
      Returns:
      the y coordinate of the center of the node.
    • setCenterY

      void setCenterY(int centerY)
      Sets the y coordinate of the center of this node.
      Parameters:
      centerY - This coordinate.
    • setCenter

      void setCenter(int centerX, int centerY)
      Sets the (x, y) coordinates of the center of this node.
      Parameters:
      centerX - The x coordinate.
      centerY - The y coordinate.
    • addPropertyChangeListener

      void addPropertyChangeListener(PropertyChangeListener l)
      Adds a property change listener.
      Parameters:
      l - This listener.
    • hashCode

      int hashCode()
      Removes a property change listener.
      Overrides:
      hashCode in class Object
      Returns:
      a hashcode for this variable.
    • equals

      boolean equals(Object o)
      Tests whether this variable is equal to the given variable.
      Overrides:
      equals in class Object
      Returns:
      true iff this variable is equal to the given variable.
    • like

      Node like(String name)
      Creates a new node of the same type as this one with the given name.
      Parameters:
      name - the name of the new node.
      Returns:
      the new node.
    • compareTo

      default int compareTo(Node node)
      Returns the hashcode for this node.
      Specified by:
      compareTo in interface Comparable<Node>
      Parameters:
      node - the object to be compared.
      Returns:
      the hashcode for this node.
    • getAllAttributes

      Map<String,Object> getAllAttributes()
    • getAttribute

      Object getAttribute(String key)
    • removeAttribute

      void removeAttribute(String key)
    • addAttribute

      void addAttribute(String key, Object value)