Class Node

java.lang.Object
ca.spatial.table.Node

public final class Node extends Object
This class represents a Node in a topological network of connectivity between blocks. There should be a one-to-one matchup of Blocks to Nodes in a properly described topology. Use the Topology class to find Nodes by block index number.

Each Node contains a list of Edge objects. Edges indicate neighbour relationships.

See Also:
Topology, Edge
  • Constructor Summary

    Constructors
    Constructor
    Description
    Node​(int index, int area, Object label)
    Create a new Node object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addEdge​(Node node, int length, float distance, boolean connectable)
    Add an Edge to this Node.
    boolean
    equals​(Object other)
     
    int
    Get the area of this Node as a scaled integer value.
    Get the list of shared Edges for this Node.
    int
    Get the index of this Node.
    Get the node label
    boolean
    hasEdge​(int index)
    Test if this Node has an edge relationship to the Node with a specified index value.
    int
     
    void
    setIndex​(int index)
     

    Methods inherited from class java.lang.Object

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

    • Node

      public Node(int index, int area, Object label)
      Create a new Node object.
      Parameters:
      index - A unique ID that is usually the same as the index of the feature that this Node represents.
      area - The area of this block as a scaled integer.
  • Method Details

    • getIndex

      public final int getIndex()
      Get the index of this Node. The index value is the same as the index of the feature that this node represents.
    • setIndex

      public void setIndex(int index)
    • getArea

      public final int getArea()
      Get the area of this Node as a scaled integer value.
    • getLabel

      public Object getLabel()
      Get the node label
    • addEdge

      public final void addEdge(Node node, int length, float distance, boolean connectable)
      Add an Edge to this Node.
      Parameters:
      node - The neighbour Node.
      length - The length of shared edge.
    • getEdges

      public final ArrayList<Edge> getEdges()
      Get the list of shared Edges for this Node.
    • hasEdge

      public final boolean hasEdge(int index)
      Test if this Node has an edge relationship to the Node with a specified index value.
      Parameters:
      index - The index value of the Node that we are testing for a neighbour relationship to the current Node.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object