Package org.arakhne.afc.math.graph
Interface GraphSegmentList<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>>
-
- Type Parameters:
PT
- is the type of node in the graphST
- is the type of edge in the graph
- All Superinterfaces:
Collection<ST>
,Iterable<ST>
,List<ST>
public interface GraphSegmentList<ST extends GraphSegment<ST,PT>,PT extends GraphPoint<PT,ST>> extends List<ST>
This class describes a path inside a graph.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:42
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgraph
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
add(ST segment, PT point)
Add the segment starting from the given point.ST
getAntepenulvianSegment()
Replies the antepenulvian segment.PT
getFirstPoint()
Replies the first point.ST
getFirstSegment()
Replies the first segment.PT
getLastPoint()
Replies the last point.ST
getLastSegment()
Replies the last segment.ST
getSecondSegment()
Replies the second element of the path if it exists.Iterator<PT>
pointIterator()
Replies an iterator on the path's points.Iterable<PT>
points()
Replies an iterator on the path's points.boolean
removeBefore(ST obj)
Remove the path's elements before the specified one.boolean
removeBefore(ST obj, PT pt)
Remove the path's elements before the specified one which is starting at the specified point.boolean
removeBeforeLast(ST obj)
Remove the path's elements before the specified one.boolean
removeBeforeLast(ST obj, PT pt)
Remove the path's elements before the specified one which is starting at the specified point.boolean
removeUntil(ST obj)
Remove the path's elements before the specified one.boolean
removeUntilLast(ST obj)
Remove the path's elements before the specified one.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Method Detail
-
pointIterator
@Pure Iterator<PT> pointIterator()
Replies an iterator on the path's points.- Returns:
- an iterator on the path's points.
-
points
@Pure Iterable<PT> points()
Replies an iterator on the path's points.- Returns:
- an iterator on the path's points.
-
add
boolean add(ST segment, PT point)
Add the segment starting from the given point.- Parameters:
segment
- is the segment to addpoint
- is the point at which the path is starting to go through the given segment.- Returns:
true
on success, otherwisefalse
-
getLastPoint
@Pure PT getLastPoint()
Replies the last point.- Returns:
- the last point.
-
getFirstPoint
@Pure PT getFirstPoint()
Replies the first point.- Returns:
- the first point.
-
getLastSegment
@Pure ST getLastSegment()
Replies the last segment.- Returns:
- the last segment or
null
.
-
getAntepenulvianSegment
@Pure ST getAntepenulvianSegment()
Replies the antepenulvian segment.- Returns:
- the antepenulvian segment or
null
.
-
getSecondSegment
@Pure ST getSecondSegment()
Replies the second element of the path if it exists.- Returns:
- the second element of the path if it exists.
-
getFirstSegment
@Pure ST getFirstSegment()
Replies the first segment.- Returns:
- the first segment or
null
.
-
removeBefore
boolean removeBefore(ST obj)
Remove the path's elements before the specified one. The specified element will not be removed.- Parameters:
obj
- the reference object.- Returns:
true
on success, otherwisefalse
-
removeBefore
boolean removeBefore(ST obj, PT pt)
Remove the path's elements before the specified one which is starting at the specified point. The specified element will not be removed.- Parameters:
obj
- the refrence segment.pt
- is the point on which the segment was connected as its first point.- Returns:
true
on success, otherwisefalse
-
removeBeforeLast
boolean removeBeforeLast(ST obj)
Remove the path's elements before the specified one. The specified element will not be removed.- Parameters:
obj
- the reference object- Returns:
true
on success, otherwisefalse
-
removeBeforeLast
boolean removeBeforeLast(ST obj, PT pt)
Remove the path's elements before the specified one which is starting at the specified point. The specified element will not be removed.- Parameters:
obj
- the refrence segment.pt
- is the point on which the segment was connected as its first point.- Returns:
true
on success, otherwisefalse
-
removeUntil
boolean removeUntil(ST obj)
Remove the path's elements before the specified one. The specified element will also be removed.- Parameters:
obj
- the refrence segment.- Returns:
true
on success, otherwisefalse
-
removeUntilLast
boolean removeUntilLast(ST obj)
Remove the path's elements before the specified one. The specified element will also be removed.- Parameters:
obj
- the refrence segment.- Returns:
true
on success, otherwisefalse
-
-