blob: a3dac452e341354437b66782e838817fd67efcec [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2014-present Open Networking Foundation
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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
7 *
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.
15 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net;
tom43387f32014-08-27 14:42:43 -070017
Andrey Komarov2398d962016-09-26 15:11:23 +030018import org.onlab.graph.Weight;
19
tom43387f32014-08-27 14:42:43 -070020import java.util.List;
21
22/**
23 * Representation of a contiguous directed path in a network. Path comprises
24 * of a sequence of links, where adjacent links must share the same device,
25 * meaning that destination of the source of one link must coincide with the
Andrey Komarov2398d962016-09-26 15:11:23 +030026 * destination of the previous link. Path weight (cost) is an aggregation
27 * of the weights of the links the path consists of.
tom43387f32014-08-27 14:42:43 -070028 */
29public interface Path extends Link {
30
31 /**
32 * Returns sequence of links comprising the path.
33 *
34 * @return list of links
35 */
36 List<Link> links();
37
tom97937552014-09-11 10:48:42 -070038 /**
39 * Returns the path cost as a unit-less value.
40 *
41 * @return unit-less path cost
Andrey Komarov2398d962016-09-26 15:11:23 +030042 *
43 * @deprecated in Junco (1.9.0), use weight() instead
tom97937552014-09-11 10:48:42 -070044 */
Andrey Komarov2398d962016-09-26 15:11:23 +030045 @Deprecated
tom97937552014-09-11 10:48:42 -070046 double cost();
47
Andrey Komarov2398d962016-09-26 15:11:23 +030048 /**
49 * Returns the path cost as an weight instance.
50 *
51 * @return weight path cost
52 */
53 Weight weight();
54
tom43387f32014-08-27 14:42:43 -070055}