Record Class CubicSpline.Multipoint<I extends BoundedFloatFunction<?>>
java.lang.Object
java.lang.Record
net.minecraft.util.CubicSpline.Multipoint<I>
- All Implemented Interfaces:
CubicSpline<I>
- Enclosing interface:
CubicSpline<I>
public static record CubicSpline.Multipoint<I extends BoundedFloatFunction<?>>(I extends BoundedFloatFunction<?> coordinate, float[] locations, List<CubicSpline<I extends BoundedFloatFunction<?>>> values, float[] derivatives)
extends Record
implements CubicSpline<I>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordCubicSpline.Multipoint.Point<I extends BoundedFloatFunction<?>>Nested classes/interfaces inherited from interface CubicSpline
CubicSpline.Builder<I>, CubicSpline.Constant<I>, CubicSpline.Multipoint<I> -
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 List<CubicSpline<I>> The field for thevaluesrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionMultipoint(I coordinate, float[] locations, List<CubicSpline<I>> values, float[] derivatives) Creates an instance of aMultipointrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <I extends BoundedFloatFunction<?>>
com.mojang.serialization.Codec<CubicSpline.Multipoint<I>> codec(com.mojang.serialization.Codec<I> coordinateCodec, com.mojang.serialization.Codec<CubicSpline<I>> subSplineCodec) Returns the value of thecoordinaterecord component.private static <I extends BoundedFloatFunction<?>>
CubicSpline.Multipoint<I> createFromPoints(I coordinate, List<CubicSpline.Multipoint.Point<I>> points) float[]Returns the value of thederivativesrecord component.booleanIndicates whether some other object is "equal to" this one.private static intfindIntervalStart(float[] locations, float input) voidforEachCoordinate(Consumer<I> consumer) inthashCode()Returns a hash code value for this object.private static floatlinearExtend(float input, float[] locations, float value, float[] derivatives, int index) float[]Returns the value of thelocationsrecord component.<R extends BoundedFloatFunction<?>>
CubicSpline<R> mapCoordinates(Function<I, R> mapper) private List<CubicSpline.Multipoint.Point<I>> range()private static <C, I extends BoundedFloatFunction<C>>
floatsample(I coordinate, float[] derivatives, float[] locations, List<CubicSpline<I>> values, C c) static <C, I extends BoundedFloatFunction<C>>
floatsample(CubicSpline.Multipoint<I> sampler, C c) final StringtoString()Returns a string representation of this record class.private static StringtoString(float[] arr) private static <I> voidvalidateSizes(float[] locations, List<CubicSpline<I>> values, float[] derivatives) List<CubicSpline<I>> values()Returns the value of thevaluesrecord component.
-
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.
-
-
Constructor Details
-
Multipoint
public Multipoint(I coordinate, float[] locations, List<CubicSpline<I>> values, float[] derivatives) 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 component
-
-
Method Details
-
range
- Specified by:
rangein interfaceCubicSpline<I extends BoundedFloatFunction<?>>
-
linearExtend
private static float linearExtend(float input, float[] locations, float value, float[] derivatives, int index) -
validateSizes
private static <I> void validateSizes(float[] locations, List<CubicSpline<I>> values, float[] derivatives) -
sample
public static <C, I extends BoundedFloatFunction<C>> float sample(CubicSpline.Multipoint<I> sampler, C c) -
sample
private static <C, I extends BoundedFloatFunction<C>> float sample(I coordinate, float[] derivatives, float[] locations, List<CubicSpline<I>> values, C c) -
findIntervalStart
private static int findIntervalStart(float[] locations, float input) -
parityString
- Specified by:
parityStringin interfaceCubicSpline<I extends BoundedFloatFunction<?>>
-
toString
-
forEachCoordinate
- Specified by:
forEachCoordinatein interfaceCubicSpline<I extends BoundedFloatFunction<?>>
-
mapCoordinates
- Specified by:
mapCoordinatesin interfaceCubicSpline<I extends BoundedFloatFunction<?>>
-
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 withObjects::equals(Object,Object). -
hashCode
-
codec
public static <I extends BoundedFloatFunction<?>> com.mojang.serialization.Codec<CubicSpline.Multipoint<I>> codec(com.mojang.serialization.Codec<I> coordinateCodec, com.mojang.serialization.Codec<CubicSpline<I>> subSplineCodec) -
packToPoints
-
createFromPoints
private static <I extends BoundedFloatFunction<?>> CubicSpline.Multipoint<I> createFromPoints(I coordinate, List<CubicSpline.Multipoint.Point<I>> points) -
toString
-
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
-