blob: 137ec8d09a08cc2918ee1444cb8b2259bd45f3ff [file] [log] [blame]
tome3489412014-08-29 02:30:38 -07001package org.onlab.graph;
2
3
4import java.util.Set;
5
6/**
7 * Abstraction of a directed graph structure.
8 *
9 * @param <V> vertex type
10 * @param <E> edge type
11 */
12public interface Graph<V extends Vertex, E extends Edge> {
13
14 /**
15 * Returns the set of vertexes comprising the graph.
16 *
17 * @return set of vertexes
18 */
19 Set<V> getVertexes();
20
21 /**
22 * Returns the set of edges comprising the graph.
23 *
24 * @return set of edges
25 */
26 Set<E> getEdges();
27
28 /**
29 * Returns all edges leading out from the specified source vertex.
30 *
31 * @param src source vertex
32 * @return set of egress edges; empty if no such edges
33 */
34 Set<E> getEdgesFrom(V src);
35
36 /**
37 * Returns all edges leading towards the specified destination vertex.
38 *
39 * @param dst destination vertex
40 * @return set of ingress vertexes; empty if no such edges
41 */
42 Set<E> getEdgesTo(V dst);
43
44}