Package it.unibo.alchemist.model.routes
Class PolygonalChain
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.Route
,java.io.Serializable
,java.lang.Iterable
public class PolygonalChain<P extends Position<out Object>> implements Route<P>
Abstract route implementation.
-
-
Constructor Summary
Constructors Constructor Description PolygonalChain(Array<P> positions)
PolygonalChain(List<P> positions)
-
Method Summary
Modifier and Type Method Description final boolean
equals(Object other)
final P
getPoint(int step)
final ImmutableList<P>
getPoints()
final int
hashCode()
final Iterator<P>
iterator()
final double
length()
final int
size()
final Stream<P>
stream()
String
toString()
Prints the class name and the list of positions. -
-
Method Detail
-
getPoint
final P getPoint(int step)
- Parameters:
step
- the step- Returns:
the step-th Position in the route
-
getPoints
final ImmutableList<P> getPoints()
- Returns:
the route as list of Position
-
hashCode
final int hashCode()
-
length
final double length()
- Returns:
the length of the route
-
size
final int size()
- Returns:
the number of points this route is made of
-
-
-
-