tom | e348941 | 2014-08-29 02:30:38 -0700 | [diff] [blame] | 1 | package org.onlab.graph; |
| 2 | |
| 3 | /** |
| 4 | * Abstraction of a mutable path that allows gradual construction. |
| 5 | */ |
| 6 | public interface MutablePath<V extends Vertex, E extends Edge<V>> extends Path<V, E> { |
| 7 | |
| 8 | /** |
| 9 | * Inserts a new edge at the beginning of this path. The edge must be |
| 10 | * adjacent to the prior start of the path. |
| 11 | * |
| 12 | * @param edge edge to be inserted |
| 13 | */ |
| 14 | void insertEdge(E edge); |
| 15 | |
| 16 | /** |
| 17 | * Appends a new edge at the end of the this path. The edge must be |
| 18 | * adjacent to the prior end of the path. |
| 19 | * |
| 20 | * @param edge edge to be inserted |
| 21 | */ |
| 22 | void appendEdge(E edge); |
| 23 | |
| 24 | /** |
tom | 144de69 | 2014-08-29 11:38:44 -0700 | [diff] [blame] | 25 | * Removes the specified edge. This edge must be either at the start or |
| 26 | * at the end of the path, or it must be a cyclic edge in order not to |
| 27 | * violate the contiguous path property. |
| 28 | * |
| 29 | * @param edge edge to be removed |
| 30 | */ |
| 31 | void removeEdge(E edge); |
| 32 | |
| 33 | /** |
tom | e348941 | 2014-08-29 02:30:38 -0700 | [diff] [blame] | 34 | * Sets the total path cost as a unit-less double. |
| 35 | * |
| 36 | * @param cost new path cost |
| 37 | */ |
| 38 | void setCost(double cost); |
| 39 | |
| 40 | /** |
| 41 | * Returns an immutable copy of this path. |
| 42 | * |
| 43 | * @return immutable copy |
| 44 | */ |
| 45 | Path<V, E> toImmutable(); |
| 46 | |
| 47 | } |