blob: 2d8420d47ecd36b6598b4f8a46b8a3746f95ffa8 [file] [log] [blame]
tome3489412014-08-29 02:30:38 -07001package org.onlab.graph;
2
3/**
4 * Abstraction of a mutable path that allows gradual construction.
5 */
6public 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 /**
tom144de692014-08-29 11:38:44 -070025 * 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 /**
tome3489412014-08-29 02:30:38 -070034 * 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}