blob: 49a6673bcd28937a00225d245f7189f888553707 [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
19import java.util.Set;
20
21/**
22 * Abstraction of a directed graph structure.
23 *
24 * @param <V> vertex type
25 * @param <E> edge type
26 */
27public interface Graph<V extends Vertex, E extends Edge> {
28
29 /**
30 * Returns the set of vertexes comprising the graph.
31 *
32 * @return set of vertexes
33 */
34 Set<V> getVertexes();
35
36 /**
37 * Returns the set of edges comprising the graph.
38 *
39 * @return set of edges
40 */
41 Set<E> getEdges();
42
43 /**
44 * Returns all edges leading out from the specified source vertex.
45 *
46 * @param src source vertex
47 * @return set of egress edges; empty if no such edges
48 */
49 Set<E> getEdgesFrom(V src);
50
51 /**
52 * Returns all edges leading towards the specified destination vertex.
53 *
54 * @param dst destination vertex
55 * @return set of ingress vertexes; empty if no such edges
56 */
57 Set<E> getEdgesTo(V dst);
58
59}