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.build.opt;
18:
19: import org.geotools.graph.build.GraphBuilder;
20: import org.geotools.graph.build.basic.BasicGraphBuilder;
21: import org.geotools.graph.structure.Edge;
22: import org.geotools.graph.structure.Node;
23: import org.geotools.graph.structure.opt.OptEdge;
24: import org.geotools.graph.structure.opt.OptNode;
25:
26: /**
27: * An implementation of GraphBuilder that builds optimized graph components.
28: *
29: * @see org.geotools.graph.structure.opt.OptNode
30: * @see org.geotools.graph.structure.opt.OptEdge
31: *
32: * @author Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
33: *
34: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/graph/src/main/java/org/geotools/graph/build/opt/OptGraphBuilder.java $
35: */
36: public class OptGraphBuilder extends BasicGraphBuilder {
37:
38: /**
39: * Creates an optimized node.
40: *
41: * @see GraphBuilder#buildNode()
42: * @see OptNode
43: */
44: public Node buildNode() {
45: return (new OptNode());
46: }
47:
48: /**
49: * Creates an optimized edge.
50: *
51: * @see GraphBuilder#buildEdge()
52: * @see OptEdge
53: */
54: public Edge buildEdge(Node nodeA, Node nodeB) {
55: return (new OptEdge((OptNode) nodeA, (OptNode) nodeB));
56: }
57:
58: }
|