org.geotools.graph.path
Class Path

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by org.geotools.graph.path.Walk
                  extended by org.geotools.graph.path.Path
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess, NodeSequence

public class Path
extends Walk

Represents a path in a graph. A path P is defined as a walk in which there are no node repetitions.

Author:
Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Path()
           
Path(java.util.Collection nodes)
           
 
Method Summary
 boolean isValid()
          Tests if the path is valid.
 
Methods inherited from class org.geotools.graph.path.Walk
add, add, add, addAll, addAll, addEdge, addEdges, buildEdges, duplicate, equals, equals, getEdges, getFirst, getLast, hashCode, isClosed, remove, remove, remove, removeAll, reverse, riterator, truncate
 
Methods inherited from class java.util.ArrayList
clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractCollection
containsAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geotools.graph.path.NodeSequence
iterator, size
 
Methods inherited from interface java.util.List
containsAll
 

Constructor Detail

Path

public Path()

Path

public Path(java.util.Collection nodes)
Method Detail

isValid

public boolean isValid()
Tests if the path is valid. A valid path satisfies two conditions:

1. Each pair of adjacent nodes share an edge.
2. There are no node repetitions.

Specified by:
isValid in interface NodeSequence
Overrides:
isValid in class Walk
Returns:
True if valid, otherwise false.


Copyright © 1996-2010 Geotools. All Rights Reserved.