1 /*
2 * Copyright (c) 2008, The JUNG Authors
3 *
4 * All rights reserved.
5 *
6 * This software is open-source under the BSD license; see either
7 * "license.txt" or
8 * https://github.com/jrtom/jung/blob/master/LICENSE for a description.
9 */
10
11 package edu.uci.ics.jung.io;
12
13 import edu.uci.ics.jung.graph.Hypergraph;
14
15 /**
16 * Interface for a reader of graph objects
17 *
18 * @author Nathan Mittler - nathan.mittler@gmail.com
19 *
20 * @param <G>
21 * the graph type
22 * @param <V> the vertex type
23 * the vertex type
24 * @param <V> the edge type
25 * the edge type
26 */
27 public interface GraphReader<G extends Hypergraph<V, E>, V, E> {
28
29 /**
30 * Reads a single graph object, if one is available.
31 *
32 * @return the next graph object, or null if none exists.
33 * @throws GraphIOException
34 * thrown if an error occurred.
35 */
36 G readGraph() throws GraphIOException;
37
38 /**
39 * Closes this resource and frees any resources.
40 *
41 * @throws GraphIOException
42 * thrown if an error occurred.
43 */
44 void close() throws GraphIOException;
45 }