Class AigNode

java.lang.Object
org.tweetyproject.graphs.util.AigNode
All Implemented Interfaces:
Comparable<AigNode>, Node

public class AigNode extends Object implements Node, Comparable<AigNode>
Representation of a node in a graph. Implements and handles all options relevant for the aig-graph-component
Author:
Lars Bengel
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    AigNode(int id, String name)
    Initializes a new node with the given ID and label
    AigNode(int id, Node node)
    Initializes a new node for the given ID and Node
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    boolean
     
    Returns the color associated with this node.
    int
    Returns the unique identifier of this node.
    Returns the name of this node.
    int
    Returns the x-coordinate of this node.
    int
    Returns the Y-coordinate of this node.
    int
     
    boolean
    Checks whether outgoing links are allowed for this node.
    boolean
    Checks whether this node is deletable.
    boolean
    Returns whether the X position of this node is fixed.
    boolean
    Checks whether the Y position of this node is fixed.
    boolean
    Checks whether the label of this node is editable.
    void
    setAllowOutgoingLinks(boolean allowOutgoingLinks)
    Sets whether this node is allowed to have outgoing links.
    void
    Sets the color of this node.
    void
    setDeletable(boolean deletable)
    Sets whether this node can be deleted.
    void
    setFixedPositionX(boolean fixedPositionX)
    Sets the X position of this node is.
    void
    setFixedPositionY(boolean fixedPositionY)
    Sets whether the Y position of this node is fixed.
    void
    setLabelEditable(boolean labelEditable)
    Sets whether the label of this node is editable.
    void
    Sets the name of this node.
    void
    setX(int x)
    Sets the x-coordinate of this node.
    void
    setY(int y)
    Sets the y-coordinate of this node.
    Converts the node to a JSON-String
    toJson(boolean deletable, boolean labelEditable, boolean fixedPositionX, boolean fixedPositionY)
    Converts the node to a JSON-String while overriding the options with the given values
     

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AigNode

      public AigNode(int id, String name)
      Initializes a new node with the given ID and label
      Parameters:
      id - unique identifier of this node
      name - some node label
    • AigNode

      public AigNode(int id, Node node)
      Initializes a new node for the given ID and Node
      Parameters:
      id - unique identifier of this node
      node - some node
  • Method Details

    • toJson

      public String toJson(boolean deletable, boolean labelEditable, boolean fixedPositionX, boolean fixedPositionY)
      Converts the node to a JSON-String while overriding the options with the given values
      Parameters:
      deletable - whether the node should be deletable
      labelEditable - whether the node label should be editable
      fixedPositionX - whether the X position should be fixed
      fixedPositionY - whether the Y position should be fixed
      Returns:
      JSON-String representation of this node
    • toJson

      public String toJson()
      Converts the node to a JSON-String
      Returns:
      JSON-String representation of this node
    • getId

      public int getId()
      Returns the unique identifier of this node.
      Returns:
      the id of this node
    • getName

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

      public void setName(String name)
      Sets the name of this node.
      Parameters:
      name - the new name to assign to this node
    • getX

      public int getX()
      Returns the x-coordinate of this node.
      Returns:
      the x-coordinate value
    • setX

      public void setX(int x)
      Sets the x-coordinate of this node.
      Parameters:
      x - the new x-coordinate value to set
    • getY

      public int getY()
      Returns the Y-coordinate of this node.
      Returns:
      the Y-coordinate value.
    • setY

      public void setY(int y)
      Sets the y-coordinate of this node.
      Parameters:
      y - the new y-coordinate value to set
    • getColor

      public String getColor()
      Returns the color associated with this node.
      Returns:
      the color of this node as a String
    • setColor

      public void setColor(String color)
      Sets the color of this node.
      Parameters:
      color - the new color to assign to this node
    • isDeletable

      public boolean isDeletable()
      Checks whether this node is deletable.
      Returns:
      true if the node can be deleted; false otherwise.
    • setDeletable

      public void setDeletable(boolean deletable)
      Sets whether this node can be deleted.
      Parameters:
      deletable - true if the node should be deletable; false otherwise
    • isLabelEditable

      public boolean isLabelEditable()
      Checks whether the label of this node is editable.
      Returns:
      true if the label can be edited; false otherwise.
    • setLabelEditable

      public void setLabelEditable(boolean labelEditable)
      Sets whether the label of this node is editable.
      Parameters:
      labelEditable - true if the label should be editable, false otherwise
    • isAllowOutgoingLinks

      public boolean isAllowOutgoingLinks()
      Checks whether outgoing links are allowed for this node.
      Returns:
      true if outgoing links are permitted; false otherwise.
    • setAllowOutgoingLinks

      public void setAllowOutgoingLinks(boolean allowOutgoingLinks)
      Sets whether this node is allowed to have outgoing links.
      Parameters:
      allowOutgoingLinks - true to allow outgoing links from this node, false otherwise
    • isFixedPositionX

      public boolean isFixedPositionX()
      Returns whether the X position of this node is fixed.
      Returns:
      true if the X position is fixed; false otherwise.
    • setFixedPositionX

      public void setFixedPositionX(boolean fixedPositionX)
      Sets the X position of this node is.
      Parameters:
      fixedPositionX - true if the X position should be fixed, false otherwise
    • isFixedPositionY

      public boolean isFixedPositionY()
      Checks whether the Y position of this node is fixed.
      Returns:
      true if the Y position is fixed; false otherwise.
    • setFixedPositionY

      public void setFixedPositionY(boolean fixedPositionY)
      Sets whether the Y position of this node is fixed.
      Parameters:
      fixedPositionY - true if the Y position should be fixed; false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(AigNode o)
      Specified by:
      compareTo in interface Comparable<AigNode>