Interface Node

All Superinterfaces:
Graphable
All Known Subinterfaces:
DirectedNode, XYNode
All Known Implementing Classes:
BasicDirectedNode, BasicDirectedXYNode, BasicNode, BasicXYNode, DelaunayNode, OptDirectedNode, OptDirectedXYNode, OptNode, OptXYNode

public interface Node extends Graphable
Represents a node in a graph. A node is a point in a graph which is iadjacent to 0 or more edges. The collection of edges that are incident/ adjacent to the node, is referred to as the "adjacency list" of the node.
Author:
Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
See Also:
  • Method Details

    • add

      void add(Edge e)
      Adds an edge to the adjacency list of the node.
      Parameters:
      e - Adjacent edge to add.
    • remove

      void remove(Edge e)
      Removes an edge from the adjacency list of the node.
      Parameters:
      e - Adjacent edge to remove.
    • getEdge

      Edge getEdge(Node other)
      Returns an edge in the adjacency list of the node that is adjacent to another specified node.

      Note: It is possible for two nodes to share multiple edges between them. In this case, getEdges(Node other) can be used to obtain a complete list.
      Parameters:
      other - The other node that the desired edge to return is adjacent to.
      Returns:
      The first edge that is found to be adjacent to the specified node.
    • getEdges

      List<? extends Edge> getEdges(Node other)
      Returns a collection of edges in the adjacency list of the node that are adjacent to another specified node.
      Parameters:
      other - The other node that the desired edges to return are adjacent to.
      Returns:
      List of all edges that are found to be adjacent to the specified node.
    • getEdges

      List<? extends Edge> getEdges()
      Returns the edge adjacency list of the node.
      Returns:
      A list containing all edges that are adjacent to the node.
    • getDegree

      int getDegree()
      Returns the degree of the node. The degree of a node is defined as the number of edges that are adjacent to the node.
      Returns:
      int Degree of node.