01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: * (C) 2002, Refractions Reserach Inc.
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation;
10: * version 2.1 of the License.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: */
17: package org.geotools.graph.io;
18:
19: import org.geotools.graph.structure.Graph;
20:
21: /**
22: * Reads and writes features to and from some permanent form.
23: *
24: * @author Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
25: *
26: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/graph/src/main/java/org/geotools/graph/io/GraphReaderWriter.java $
27: */
28: public interface GraphReaderWriter {
29:
30: /**
31: * Sets a property for the reader/writer.
32: *
33: * @param name Name of the property.
34: * @param obj Value of the property.
35: */
36: public void setProperty(String name, Object obj);
37:
38: /**
39: * Returns a property for the reader/writer. This method will return null
40: * if the property has not been set with a call to setProperty(String,Object).
41: *
42: * @param name Name of the property.
43: * @return Value of the property or null if the property is undefined.
44: */
45: public Object getProperty(String name);
46:
47: /**
48: * Creates a Graph from some permanent representation.
49: *
50: * @return The represented graph.
51: *
52: * @throws Exception
53: */
54: public Graph read() throws Exception;
55:
56: /**
57: * Writes the graph to a permanent representation.
58: *
59: * @param g The graph to be
60: * @throws Exception
61: */
62: public void write(Graph g) throws Exception;
63:
64: }
|