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