@Test public void appendEdge() { MutablePath<TestVertex, TestEdge> p = new DefaultMutablePath<>(); p.appendEdge(new TestEdge(A, B, 1)); p.appendEdge(new TestEdge(B, C, 1)); validatePath(p, A, C, 2); }
@Override public void appendEdge(E edge) { checkNotNull(edge, "Edge cannot be null"); checkArgument(edges.isEmpty() || dst().equals(edge.src()), "Edge source must be the same as the current path destination"); edges.add(edge); }
DefaultMutablePath implements MutablePath<V, E> { @Override public void appendEdge(E edge) { checkNotNull(edge, "Edge cannot be null"); checkArgument(edges.isEmpty() || dst().equals(edge.src()), "Edge source must be the same as the current path destination"); edges.add(edge); } }
DefaultMutablePath implements MutablePath<V, E> { @Override public void appendEdge(E edge) { checkNotNull(edge, "Edge cannot be null"); checkArgument(edges.isEmpty() || dst().equals(edge.src()), "Edge source must be the same as the current path destination"); edges.add(edge); } DefaultMutablePath();  DefaultMutablePath(Path<V, E> path); }
DefaultMutablePath implements MutablePath<V, E> { @Override public void appendEdge(E edge) { checkNotNull(edge, "Edge cannot be null"); checkArgument(edges.isEmpty() || dst().equals(edge.src()), "Edge source must be the same as the current path destination"); edges.add(edge); } DefaultMutablePath();  DefaultMutablePath(Path<V, E> path); @Override V src(); @Override V dst(); @Override double cost(); @Override List<E> edges(); @Override void setCost(double cost); @Override Path<V, E> toImmutable(); @Override void insertEdge(E edge); @Override void appendEdge(E edge); @Override void removeEdge(E edge); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
DefaultMutablePath implements MutablePath<V, E> { @Override public void appendEdge(E edge) { checkNotNull(edge, "Edge cannot be null"); checkArgument(edges.isEmpty() || dst().equals(edge.src()), "Edge source must be the same as the current path destination"); edges.add(edge); } DefaultMutablePath();  DefaultMutablePath(Path<V, E> path); @Override V src(); @Override V dst(); @Override double cost(); @Override List<E> edges(); @Override void setCost(double cost); @Override Path<V, E> toImmutable(); @Override void insertEdge(E edge); @Override void appendEdge(E edge); @Override void removeEdge(E edge); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }