Class PathImpl
java.lang.Object
de.bsommerfeld.pathetic.engine.result.PathImpl
- All Implemented Interfaces:
Path,Iterable<PathPosition>
-
Constructor Summary
ConstructorsConstructorDescriptionPathImpl(PathPosition start, PathPosition end, Iterable<PathPosition> positions) -
Method Summary
Modifier and TypeMethodDescriptioncollect()Returns a new Collection of the Path Positions of the path.voidforEach(Consumer<? super PathPosition> action) getEnd()Returns the target position of the pathgetStart()Returns the start position of the pathinterpolate(double resolution) Deprecated.iterator()Deprecated.Delegates toPathUtils- you should use that too!intlength()The length of the Path compiled from the number of positionsmutatePositions(ParameterizedSupplier<PathPosition> mutator) Deprecated.Delegates toPathUtils- you should use that too!simplify(double epsilon) Deprecated.Delegates toPathUtils- you should use that too!trim(int length) Deprecated.Delegates toPathUtils- you should use that too!Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
spliterator
-
Constructor Details
-
PathImpl
-
-
Method Details
-
getStart
Description copied from interface:PathReturns the start position of the path- Specified by:
getStartin interfacePath- Returns:
PathPositionThe position of the start
-
getEnd
Description copied from interface:PathReturns the target position of the path- Specified by:
getEndin interfacePath- Returns:
PathPositionThe position of the target
-
iterator
- Specified by:
iteratorin interfaceIterable<PathPosition>
-
forEach
- Specified by:
forEachin interfaceIterable<PathPosition>
-
interpolate
Deprecated.Delegates toPathUtils- you should use that too!Description copied from interface:PathInterpolates the positions of this Path to a new Path with the given resolution.The resulting path will have additional positions inserted between consecutive positions in the original path such that no two consecutive positions are more than `resolution` blocks apart. The interpolated positions are computed using linear interpolation, which means that the resulting path will have a smooth curve that passes through each of the original positions.
- Specified by:
interpolatein interfacePath- Parameters:
resolution- The desired distance between consecutive positions in the resulting path, in blocks. A lower value will result in a higher resolution and a smoother curve, but will also increase the number of positions in the resulting path and possibly reduce performance.- Returns:
- a newly created Path with interpolated positions.
-
simplify
Deprecated.Delegates toPathUtils- you should use that too!Description copied from interface:PathSimplifies the path by removing intermediate positions based on the given epsilon value. The start and end positions are always included in the simplified path. -
join
Deprecated.Delegates toPathUtils- you should use that too!Description copied from interface:PathJoins this Path with the given Path. -
trim
Deprecated.Delegates toPathUtils- you should use that too!Description copied from interface:PathTrims this Path to the given length. -
mutatePositions
Deprecated.Delegates toPathUtils- you should use that too!Description copied from interface:PathMutates each of the positions in the path with the given consumer- Specified by:
mutatePositionsin interfacePath- Parameters:
mutator- theParameterizedSupplierto mutate the positions with- Returns:
Paththe new Path
-
length
public int length()Description copied from interface:PathThe length of the Path compiled from the number of positions -
collect
Description copied from interface:PathReturns a new Collection of the Path Positions of the path.- Specified by:
collectin interfacePath- Returns:
Collectionof the PathPositions
-
PathUtils- you should use that too!