Package civitas.celestis.util.tuple
Interface FloatTuple
- All Superinterfaces:
BaseTuple<Float>,Serializable
- All Known Implementing Classes:
Float1,Float2,Float3,Float4,FloatArrayTuple
A specialized tuple which holds the primitive type
float. Float tuples
* can be converted to their boxed form by calling boxed().- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfloat[]array()Returns an array containing the components of this tuple in their proper order.boxed()Returns a tuple containing the components of this tuple in their boxed form.booleancontains(float v) Checks if this tuple contains the provided valuev.booleancontainsAll(Iterable<Float> i) Checks if this tuple contains multiple values.static FloatTupleempty()Returns an empty float tuple.booleanChecks for equality between this tuple and the provided objectobj.default FloatArrayReturns a float array containing the components of this tuple in their proper order.floatget(int i) Returns theith component of this tuple.booleanisFinite()Returns whether this tuple is finite.booleanReturns whether this tuple is infinite.booleanisNaN()Returns whether this tuple containsFloat.NaN.booleanisZero()Returns whether this tuple represents zero.list()Returns an unmodifiable list containing the components of this tuple in their proper order.Applies the provided mapper functionfto each component of this tuple, then returns a new tuple containing the return values of the functionf.<F> Tuple<F>mapToObj(FloatFunction<? extends F> f) Applies the provided mapper functionfto each component of this tuple, then returns a new tuple containing the return values of the functionf.static FloatTupleof(float... components) Creates a new float tuple from the provided array of components.static FloatTupleCreates a new float tuple from the provided array of components.intsize()Returns the size of this tuple.stream()Returns a stream whose source is the elements of this tuple.toString()Serializes this tuple into a string.
-
Method Details
-
of
Creates a new float tuple from the provided array of components.- Parameters:
components- The components of which to construct the tuple from- Returns:
- A tuple constructed from the provided components
-
of
Creates a new float tuple from the provided array of components.- Parameters:
components- The components of which to construct the tuple from- Returns:
- A tuple constructed from the provided components
-
empty
Returns an empty float tuple.- Returns:
- An empty float tuple
-
size
int size()Returns the size of this tuple. (the number of components it has) -
isZero
boolean isZero()Returns whether this tuple represents zero. (whether every component is zero)- Returns:
trueif every component of this tuple is zero
-
isNaN
boolean isNaN()Returns whether this tuple containsFloat.NaN.- Returns:
trueif at least one component of this tuple is not a number- See Also:
-
isFinite
boolean isFinite()Returns whether this tuple is finite.- Returns:
trueif every component of this tuple is finite- See Also:
-
isInfinite
boolean isInfinite()Returns whether this tuple is infinite.- Returns:
trueif at least one component of this tuple is infinite- See Also:
-
contains
boolean contains(float v) Checks if this tuple contains the provided valuev.- Parameters:
v- The value of which to check for containment- Returns:
trueif at least one component of this tuple is equal to the provided valuev
-
containsAll
Checks if this tuple contains multiple values.- Parameters:
i- The iterable object of which to check for containment- Returns:
trueif this tuple contains every component of the iterable object
-
get
Returns theith component of this tuple.- Parameters:
i- The index of the component to get- Returns:
- The
ith component of this tuple - Throws:
IndexOutOfBoundsException- When the indexiis out of bounds
-
map
Applies the provided mapper functionfto each component of this tuple, then returns a new tuple containing the return values of the functionf.- Parameters:
f- The function of which to apply to each component of this tuple- Returns:
- The resulting tuple
-
mapToObj
Applies the provided mapper functionfto each component of this tuple, then returns a new tuple containing the return values of the functionf.- Type Parameters:
F- The type of component to map this tuple to- Parameters:
f- The function of which to apply to each component of this tuple- Returns:
- The resulting tuple
-
array
@Nonnull float[] array()Returns an array containing the components of this tuple in their proper order.- Returns:
- The array representation of this tuple
-
floatArray
Returns a float array containing the components of this tuple in their proper order.- Returns:
- The array representation of this tuple
- See Also:
-
stream
Returns a stream whose source is the elements of this tuple.- Returns:
- A stream whose source is the elements of this tuple
- See Also:
-
list
Returns an unmodifiable list containing the components of this tuple in their proper order. -
boxed
Returns a tuple containing the components of this tuple in their boxed form.- Returns:
- The boxed object representation of this tuple
- See Also:
-
equals
Checks for equality between this tuple and the provided objectobj. -
toString
Serializes this tuple into a string.
-