Class Node


  • public class Node
    extends GraphComponent
    A node in a PlanarGraphis a location where 0 or more Edges meet. A node is connected to each of its incident Edges via an outgoing DirectedEdge. Some clients using a PlanarGraph may want to subclass Node to add their own application-specific data and methods.
    Version:
    1.7
    • Constructor Detail

      • Node

        public Node​(Coordinate pt)
        Constructs a Node with the given location.
      • Node

        public Node​(Coordinate pt,
                    DirectedEdgeStar deStar)
        Constructs a Node with the given location and collection of outgoing DirectedEdges.
    • Method Detail

      • getEdgesBetween

        public static java.util.Collection getEdgesBetween​(Node node0,
                                                           Node node1)
        Returns all Edges that connect the two nodes (which are assumed to be different).
      • getCoordinate

        public Coordinate getCoordinate()
        Returns the location of this Node.
      • addOutEdge

        public void addOutEdge​(DirectedEdge de)
        Adds an outgoing DirectedEdge to this Node.
      • getOutEdges

        public DirectedEdgeStar getOutEdges()
        Returns the collection of DirectedEdges that leave this Node.
      • getDegree

        public int getDegree()
        Returns the number of edges around this Node.
      • getIndex

        public int getIndex​(Edge edge)
        Returns the zero-based index of the given Edge, after sorting in ascending order by angle with the positive x-axis.
      • remove

        public void remove​(DirectedEdge de)
        Removes a DirectedEdge incident on this node. Does not change the state of the directed edge.
      • isRemoved

        public boolean isRemoved()
        Tests whether this node has been removed from its containing graph
        Specified by:
        isRemoved in class GraphComponent
        Returns:
        true if this node is removed