1 package org.apache.commons.graph;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import java.util.Set;
23
24 /**
25 * A {@code DirectedGraph} or <i>digraph</i> is an ordered pair {@code D = ( V, E )} with
26 * <ul>
27 * {@code V} a set whose elements are called vertices or nodes, and
28 * {@code E} a set of ordered pairs of vertices, called arcs, directed edges, or arrows.
29 * </ul>
30 *
31 * @param <V> the Graph vertices type
32 * @param <E> the Graph edges type
33 */
34 public interface DirectedGraph<V extends Vertex, E extends Edge<V>>
35 extends Graph<V, E>
36 {
37
38 /**
39 * Returns the set of {@link Edge}s which are inbound to the {@link Vertex}.
40 *
41 * @param v the {@link Vertex} which inbound {@link Edge}s have to be returned
42 * @return the set of {@link Edge}s which are inbound to the {@link Vertex}.
43 */
44 Set<E> getInbound( V v );
45
46 /**
47 * Returns the set of {@link Edge}s which lead away from the {@link Vertex}.
48 *
49 * @param v the {@link Vertex} which outbound {@link Edge}s have to be returned
50 * @return the set of {@link Edge}s which lead away from the {@link Vertex}.
51 */
52 Set<E> getOutbound( V v );
53
54 }