Thomas Vachuska | 24c849c | 2014-10-27 09:53:05 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 24c849c | 2014-10-27 09:53:05 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 4 | * 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 Vachuska | 24c849c | 2014-10-27 09:53:05 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 8 | * 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 Vachuska | 24c849c | 2014-10-27 09:53:05 -0700 | [diff] [blame] | 15 | */ |
tom | e348941 | 2014-08-29 02:30:38 -0700 | [diff] [blame] | 16 | package org.onlab.graph; |
| 17 | |
| 18 | /** |
| 19 | * Abstraction of a mutable path that allows gradual construction. |
| 20 | */ |
| 21 | public 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 | /** |
tom | 144de69 | 2014-08-29 11:38:44 -0700 | [diff] [blame] | 40 | * 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 | /** |
tom | e348941 | 2014-08-29 02:30:38 -0700 | [diff] [blame] | 49 | * Sets the total path cost as a unit-less double. |
| 50 | * |
| 51 | * @param cost new path cost |
| 52 | */ |
| 53 | void setCost(double cost); |
| 54 | |
| 55 | /** |
| 56 | * Returns an immutable copy of this path. |
| 57 | * |
| 58 | * @return immutable copy |
| 59 | */ |
| 60 | Path<V, E> toImmutable(); |
| 61 | |
| 62 | } |