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.path;
18:
19: import java.util.Iterator;
20:
21: import org.geotools.graph.structure.Node;
22:
23: /**
24: * Represents a sequence of nodes in a graph.
25: *
26: * @author Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
27: *
28: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/graph/src/main/java/org/geotools/graph/path/NodeSequence.java $
29: */
30: public interface NodeSequence {
31:
32: /**
33: * Returns the first node in the sequence.
34: *
35: * @return Object of tupe Node.
36: */
37: public Node getFirst();
38:
39: /**
40: * Returns the last node in the sequence.
41: *
42: * @return Object of type node.
43: */
44: public Node getLast();
45:
46: /**
47: * Returns the number of nodes in the sequence.
48: *
49: * @return an integer representing the number of nodes in the sequence.
50: */
51: public int size();
52:
53: /**
54: * Returns an iterator over the nodes.
55: *
56: * @return An iterator.
57: */
58: public Iterator iterator();
59:
60: /**
61: * Determines if the node sequence id valid based on the rules of the
62: * implementation.
63: *
64: * @return True if valid, otherwise false.
65: */
66: public boolean isValid();
67: }
|