blob: 3a3b47952d4e5c7193c82aa38f35c01b828591f8 [file] [log] [blame]
Thomas Vachuska24c849c2014-10-27 09:53:05 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present Open Networking Laboratory
Thomas Vachuska24c849c2014-10-27 09:53:05 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Thomas Vachuska24c849c2014-10-27 09:53:05 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Thomas Vachuska24c849c2014-10-27 09:53:05 -070015 */
tome3489412014-08-29 02:30:38 -070016package org.onlab.graph;
17
18/**
19 * Abstraction of a mutable path that allows gradual construction.
20 */
21public interface MutablePath<V extends Vertex, E extends Edge<V>> extends Path<V, E> {
22
23 /**
24 * Inserts a new edge at the beginning of this path. The edge must be
25 * adjacent to the prior start of the path.
26 *
27 * @param edge edge to be inserted
28 */
29 void insertEdge(E edge);
30
31 /**
32 * Appends a new edge at the end of the this path. The edge must be
33 * adjacent to the prior end of the path.
34 *
35 * @param edge edge to be inserted
36 */
37 void appendEdge(E edge);
38
39 /**
tom144de692014-08-29 11:38:44 -070040 * Removes the specified edge. This edge must be either at the start or
41 * at the end of the path, or it must be a cyclic edge in order not to
42 * violate the contiguous path property.
43 *
44 * @param edge edge to be removed
45 */
46 void removeEdge(E edge);
47
48 /**
Andrey Komarov2398d962016-09-26 15:11:23 +030049 * Sets the total path cost as a weight object.
tome3489412014-08-29 02:30:38 -070050 *
51 * @param cost new path cost
52 */
Andrey Komarov2398d962016-09-26 15:11:23 +030053 void setCost(Weight cost);
tome3489412014-08-29 02:30:38 -070054
55 /**
56 * Returns an immutable copy of this path.
57 *
58 * @return immutable copy
59 */
60 Path<V, E> toImmutable();
61
62}