Class Connection<V>

java.lang.Object
com.github.yellowstonegames.path.Edge<V>
com.github.yellowstonegames.path.Connection<V>
Type Parameters:
V - the vertex type; often Coord
Direct Known Subclasses:
Connection.DirectedConnection, Connection.UndirectedConnection

public abstract class Connection<V> extends Edge<V>
The most-commonly-used class that represents an edge between nodes on a Graph. Different kinds of graph will use different subclasses of this to represent their edges: Connection.DirectedConnection or Connection.UndirectedConnection. These subclasses don't add new functionality, but they compare differently during hashing and equality checks.
  • Field Details

    • DEFAULT_WEIGHT

      protected static final float DEFAULT_WEIGHT
      See Also:
    • a

      protected Node<V> a
    • b

      protected Node<V> b
    • weight

      protected float weight
  • Constructor Details

    • Connection

      public Connection()
    • Connection

      public Connection(Node<V> a, Node<V> b)
    • Connection

      public Connection(Node<V> a, Node<V> b, float weight)
  • Method Details

    • set

      protected void set(Node<V> a, Node<V> b, float weight)
      Specified by:
      set in class Edge<V>
    • getInternalNodeA

      protected Node<V> getInternalNodeA()
      Specified by:
      getInternalNodeA in class Edge<V>
    • getInternalNodeB

      protected Node<V> getInternalNodeB()
      Specified by:
      getInternalNodeB in class Edge<V>
    • getA

      public V getA()
      Specified by:
      getA in class Edge<V>
    • getB

      public V getB()
      Specified by:
      getB in class Edge<V>
    • getWeight

      public float getWeight()
      Specified by:
      getWeight in class Edge<V>
    • setWeight

      public void setWeight(float weight)
      Specified by:
      setWeight in class Edge<V>
    • getNodeA

      public Node<V> getNodeA()
    • getNodeB

      public Node<V> getNodeB()