Package game

Class Edge

java.lang.Object
game.Edge

public class Edge extends Object
An Edge represents an immutable directed, weighted edge.
  • Field Details

    • length

      public final int length
      The length of this edge
  • Constructor Details

    • Edge

      public Edge(Node src, Node dest, int length)
      Constructor: an edge from src to dest with length length.
    • Edge

      public Edge(Edge e, Map<Node,Node> iso)
      Constructor: an edge that is isomorphic to iso.
  • Method Details

    • getOther

      public Node getOther(Node n)
      Return the Node on this Edge that is not equal to n. Throw an IllegalArgumentException if n is not in this Edge.
    • length

      public int length()
      Return the length of this Edge
    • source

      public Node source()
      Return the source of this edge.
    • destination

      public Node destination()
      Return destination of edge