Class Edge

java.lang.Object
ca.spatial.table.Edge

public class Edge extends Object
This class is used to describe neighbour relationships between polygon. Edges may be touching (distance == 0) in which case they have a shared edge length. Edges may also be proximal, in which case they will have shared edge length == 0 and a non-zero distance.
See Also:
Node, Topology
  • Constructor Summary

    Constructors
    Constructor
    Description
    Edge​(Node node, int length, float distance, boolean connectable)
    Create an Edge to a neighbour Node
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addLength​(int length, float distance)
    Increase the value of the shared edge with this neighbour.
    boolean
    Get the connectability attribute
    float
    Get the minimum distance between the neighbours.
    int
    Get the length of the shared edge between these neighbours.
    Get the Node object at the other end of this edge.
    void
    setConnectable​(boolean connectable)
    Set the connectability attribute

    Methods inherited from class java.lang.Object

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

    • Edge

      public Edge(Node node, int length, float distance, boolean connectable)
      Create an Edge to a neighbour Node
      Parameters:
      node - The Node of the neighbour
      length - The length of the shared edge between these neighbours.
      distance - The minimum distance between the neighbours.
      connectable - Are connections allowed on this edge?
      See Also:
      Topology, Node
  • Method Details

    • getNode

      public Node getNode()
      Get the Node object at the other end of this edge.
    • getLength

      public int getLength()
      Get the length of the shared edge between these neighbours. If the neighbours are not touching (strictly adjacent) then there is no shared edge.
    • getDistance

      public float getDistance()
      Get the minimum distance between the neighbours.
    • getConnectable

      public boolean getConnectable()
      Get the connectability attribute
    • setConnectable

      public void setConnectable(boolean connectable)
      Set the connectability attribute
    • addLength

      public void addLength(int length, float distance)
      Increase the value of the shared edge with this neighbour. Neighbours may have several edges that they share, and this method helps contruct edges with multiple pieces.
      Parameters:
      length - The additional length to add to this shared edge.
      distance - The minimum distance between the neighbours for this edge.