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.traverse.basic;
18:
19: import org.geotools.graph.structure.Graph;
20: import org.geotools.graph.traverse.GraphIterator;
21: import org.geotools.graph.traverse.GraphTraversal;
22: import org.geotools.graph.traverse.GraphWalker;
23:
24: /**
25: * An abstract implementation of GraphIterator.
26: *
27: * @author Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
28: *
29: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/graph/src/main/java/org/geotools/graph/traverse/basic/AbstractGraphIterator.java $
30: */
31: public abstract class AbstractGraphIterator implements GraphIterator {
32:
33: private GraphTraversal m_traversal;
34:
35: /**
36: * @see GraphIterator#setTraversal(GraphTraversal)
37: */
38: public void setTraversal(GraphTraversal traversal) {
39: m_traversal = traversal;
40: }
41:
42: /**
43: * @see GraphIterator#getTraversal()
44: */
45: public GraphTraversal getTraversal() {
46: return (m_traversal);
47: }
48:
49: /**
50: * Returns the graph being traversed.
51: *
52: * @return The graph being traversed.
53: *
54: * @see Graph
55: */
56: public Graph getGraph() {
57: return (m_traversal.getGraph());
58: }
59:
60: /**
61: * Returns the walker being traversed over the graph.
62: *
63: * @return The walker being traversed over the graph.
64: *
65: * @see GraphWalker
66: */
67:
68: public GraphWalker getWalker() {
69: return (m_traversal.getWalker());
70: }
71: }
|