Package net.minecraft.util
Record Class CubicSpline.Multipoint<C,I extends BoundedFloatFunction<C>>
java.lang.Object
java.lang.Record
net.minecraft.util.CubicSpline.Multipoint<C,I>
- All Implemented Interfaces:
BoundedFloatFunction<C>,CubicSpline<C,I>
- Enclosing interface:
CubicSpline<C,I extends BoundedFloatFunction<C>>
public static record CubicSpline.Multipoint<C,I extends BoundedFloatFunction<C>> (I extends BoundedFloatFunction<C> coordinate, float[] locations, List<CubicSpline<C,I extends BoundedFloatFunction<C>>> values, float[] derivatives, float minValue, float maxValue)
extends Record
implements CubicSpline<C,I>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.util.CubicSpline
CubicSpline.Builder<C,I extends BoundedFloatFunction<C>>, CubicSpline.Constant<C, I extends BoundedFloatFunction<C>>, CubicSpline.CoordinateVisitor<I>, CubicSpline.Multipoint<C, I extends BoundedFloatFunction<C>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IThe field for thecoordinaterecord component.private final float[]The field for thederivativesrecord component.private final float[]The field for thelocationsrecord component.private final floatThe field for themaxValuerecord component.private final floatThe field for theminValuerecord component.private final List<CubicSpline<C, I>> The field for thevaluesrecord component.Fields inherited from interface net.minecraft.util.BoundedFloatFunction
IDENTITY -
Constructor Summary
ConstructorsConstructorDescriptionMultipoint(I coordinate, float[] locations, List<CubicSpline<C, I>> values, float[] derivatives, float minValue, float maxValue) Creates an instance of aMultipointrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of thecoordinaterecord component.(package private) static <C,I extends BoundedFloatFunction<C>>
CubicSpline.Multipoint<C, I> create(I pCoordinate, float[] pLocations, List<CubicSpline<C, I>> pValues, float[] pDerivatives) float[]Returns the value of thederivativesrecord component.final booleanIndicates whether some other object is "equal to" this one.private static intfindIntervalStart(float[] pLocations, float pStart) final inthashCode()Returns a hash code value for this object.private static floatlinearExtend(float pCoordinate, float[] pLocations, float pValue, float[] pDerivatives, int pIndex) float[]Returns the value of thelocationsrecord component.mapAll(CubicSpline.CoordinateVisitor<I> p_211585_) floatmaxValue()Returns the value of themaxValuerecord component.floatminValue()Returns the value of theminValuerecord component.final StringtoString()Returns a string representation of this record class.private StringtoString(float[] pLocations) private static <C,I extends BoundedFloatFunction<C>>
voidvalidateSizes(float[] pLocations, List<CubicSpline<C, I>> pValues, float[] pDerivatives) List<CubicSpline<C, I>> values()Returns the value of thevaluesrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.util.BoundedFloatFunction
comap
-
Field Details
-
coordinate
The field for thecoordinaterecord component. -
locations
private final float[] locationsThe field for thelocationsrecord component. -
values
The field for thevaluesrecord component. -
derivatives
private final float[] derivativesThe field for thederivativesrecord component. -
minValue
private final float minValueThe field for theminValuerecord component. -
maxValue
private final float maxValueThe field for themaxValuerecord component.
-
-
Constructor Details
-
Multipoint
public Multipoint(I coordinate, float[] locations, List<CubicSpline<C, I>> values, float[] derivatives, float minValue, float maxValue) Creates an instance of aMultipointrecord class.- Parameters:
coordinate- the value for thecoordinaterecord componentlocations- the value for thelocationsrecord componentvalues- the value for thevaluesrecord componentderivatives- the value for thederivativesrecord componentminValue- the value for theminValuerecord componentmaxValue- the value for themaxValuerecord component
-
-
Method Details
-
create
static <C,I extends BoundedFloatFunction<C>> CubicSpline.Multipoint<C,I> create(I pCoordinate, float[] pLocations, List<CubicSpline<C, I>> pValues, float[] pDerivatives) -
linearExtend
private static float linearExtend(float pCoordinate, float[] pLocations, float pValue, float[] pDerivatives, int pIndex) -
validateSizes
private static <C,I extends BoundedFloatFunction<C>> void validateSizes(float[] pLocations, List<CubicSpline<C, I>> pValues, float[] pDerivatives) -
apply
- Specified by:
applyin interfaceBoundedFloatFunction<C>
-
findIntervalStart
private static int findIntervalStart(float[] pLocations, float pStart) -
parityString
- Specified by:
parityStringin interfaceCubicSpline<C,I extends BoundedFloatFunction<C>>
-
toString
-
mapAll
- Specified by:
mapAllin interfaceCubicSpline<C,I extends BoundedFloatFunction<C>>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
coordinate
Returns the value of thecoordinaterecord component.- Returns:
- the value of the
coordinaterecord component
-
locations
public float[] locations()Returns the value of thelocationsrecord component.- Returns:
- the value of the
locationsrecord component
-
values
Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-
derivatives
public float[] derivatives()Returns the value of thederivativesrecord component.- Returns:
- the value of the
derivativesrecord component
-
minValue
public float minValue()Returns the value of theminValuerecord component.- Specified by:
minValuein interfaceBoundedFloatFunction<C>- Returns:
- the value of the
minValuerecord component
-
maxValue
public float maxValue()Returns the value of themaxValuerecord component.- Specified by:
maxValuein interfaceBoundedFloatFunction<C>- Returns:
- the value of the
maxValuerecord component
-