Package frc.robot.lib.BLine
Record Class Path.RangedConstraint
java.lang.Object
java.lang.Record
frc.robot.lib.BLine.Path.RangedConstraint
- Record Components:
value- The constraint value (velocity or acceleration)startOrdinal- The first element ordinal this constraint applies toendOrdinal- The last element ordinal this constraint applies to
- Enclosing class:
- Path
public static record Path.RangedConstraint(double value, int startOrdinal, int endOrdinal)
extends Record
A constraint value that applies to a range of path elements.
Ranged constraints allow different velocity/acceleration limits for different sections of a path. The constraint applies to elements with ordinals between startOrdinal and endOrdinal (inclusive).
-
Constructor Summary
ConstructorsConstructorDescriptionRangedConstraint(double value, int startOrdinal, int endOrdinal) Creates an instance of aRangedConstraintrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theendOrdinalrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thestartOrdinalrecord component.final StringtoString()Returns a string representation of this record class.doublevalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
RangedConstraint
public RangedConstraint(double value, int startOrdinal, int endOrdinal) Creates an instance of aRangedConstraintrecord class.- Parameters:
value- the value for thevaluerecord componentstartOrdinal- the value for thestartOrdinalrecord componentendOrdinal- the value for theendOrdinalrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
value
public double value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
startOrdinal
public int startOrdinal()Returns the value of thestartOrdinalrecord component.- Returns:
- the value of the
startOrdinalrecord component
-
endOrdinal
public int endOrdinal()Returns the value of theendOrdinalrecord component.- Returns:
- the value of the
endOrdinalrecord component
-