Class MotionProfile
- java.lang.Object
-
- org.team1540.rooster.motionprofiling.MotionProfile
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MotionProfile.Point
A single instant within aMotionProfile
.
-
Field Summary
Fields Modifier and Type Field Description @NotNull MotionProfile.Point[]
points
ThePoints
in the motion profile.
-
Constructor Summary
Constructors Constructor Description MotionProfile(@NotNull MotionProfile.Point[] points)
Create a newMotionProfile
from an array of points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MotionProfile.Point
get(int index)
Gets the nthMotionProfile.Point
(0-indexed) in the motion profile.int
size()
Get the number ofpoints
in the profile.
-
-
-
Field Detail
-
points
@NotNull public final @NotNull MotionProfile.Point[] points
ThePoints
in the motion profile.
-
-
Constructor Detail
-
MotionProfile
public MotionProfile(@NotNull @NotNull MotionProfile.Point[] points)
Create a newMotionProfile
from an array of points.- Parameters:
points
- The points to use.
-
-
Method Detail
-
get
@Contract(pure=true) public MotionProfile.Point get(int index)
Gets the nthMotionProfile.Point
(0-indexed) in the motion profile.- Parameters:
index
- The index of the point to get.- Returns:
- The point at the specified index.
- Throws:
ArrayIndexOutOfBoundsException
- ifindex
≥size()
.
-
size
@Contract(pure=true) public int size()
Get the number ofpoints
in the profile.- Returns:
- The number of points in the profile; specifically,
points.length
.
-
-