Class PathFinder.Path
- All Implemented Interfaces:
Iterable<Relationship>
,Collection<Relationship>
,List<Relationship>
- Enclosing class:
- PathFinder
An immutable
Relationship
path from a starting shape to an end shape.-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget
(int index) Gets the ending shape of thePath
that matched the selector and is connected to the starting shape.Gets a list of all shapes in the path including the starting shape all the way to the last shape.Gets the starting shape of thePath
.iterator()
int
size()
toString()
Converts the path to validSelector
syntax.Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
Path
-
-
Method Details
-
size
public int size()- Specified by:
size
in interfaceCollection<Relationship>
- Specified by:
size
in interfaceList<Relationship>
- Specified by:
size
in classAbstractCollection<Relationship>
-
get
- Specified by:
get
in interfaceList<Relationship>
- Specified by:
get
in classAbstractList<Relationship>
-
iterator
- Specified by:
iterator
in interfaceCollection<Relationship>
- Specified by:
iterator
in interfaceIterable<Relationship>
- Specified by:
iterator
in interfaceList<Relationship>
- Overrides:
iterator
in classAbstractList<Relationship>
-
getShapes
Gets a list of all shapes in the path including the starting shape all the way to the last shape.The returned list does not return the last element (the end shape targeted by the last neighbor) if it does not exist.
- Returns:
- Returns the list of shapes.
-
getStartShape
Gets the starting shape of thePath
.- Returns:
- Returns the starting shape of the Path.
-
getEndShape
Gets the ending shape of thePath
that matched the selector and is connected to the starting shape.- Returns:
- Returns the ending shape of the Path.
- Throws:
SourceException
- if the last relationship is invalid.
-
toString
Converts the path to validSelector
syntax.- Overrides:
toString
in classAbstractCollection<Relationship>
- Returns:
- Returns the path as a selector.
-