Interface FloatTuple

All Superinterfaces:
BaseTuple<Float>, Serializable
All Known Implementing Classes:
Float1, Float2, Float3, Float4, FloatArrayTuple

public interface FloatTuple extends BaseTuple<Float>
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 Type
    Method
    Description
    float[]
    Returns an array containing the components of this tuple in their proper order.
    Returns a tuple containing the components of this tuple in their boxed form.
    boolean
    contains(float v)
    Checks if this tuple contains the provided value v.
    boolean
    Checks if this tuple contains multiple values.
    static FloatTuple
    Returns an empty float tuple.
    boolean
    Checks for equality between this tuple and the provided object obj.
    default FloatArray
    Returns a float array containing the components of this tuple in their proper order.
    float
    get(int i)
    Returns the ith component of this tuple.
    boolean
    Returns whether this tuple is finite.
    boolean
    Returns whether this tuple is infinite.
    boolean
    Returns whether this tuple contains Float.NaN.
    boolean
    Returns whether this tuple represents zero.
    Returns an unmodifiable list containing the components of this tuple in their proper order.
    Applies the provided mapper function f to each component of this tuple, then returns a new tuple containing the return values of the function f.
    <F> Tuple<F>
    mapToObj(FloatFunction<? extends F> f)
    Applies the provided mapper function f to each component of this tuple, then returns a new tuple containing the return values of the function f.
    static FloatTuple
    of(float... components)
    Creates a new float tuple from the provided array of components.
    static FloatTuple
    of(Float[] components)
    Creates a new float tuple from the provided array of components.
    int
    Returns the size of this tuple.
    Returns a stream whose source is the elements of this tuple.
    Serializes this tuple into a string.
  • Method Details

    • of

      @Nonnull static FloatTuple of(@Nonnull float... components)
      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

      @Nonnull static FloatTuple of(@Nonnull Float[] components)
      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

      @Nonnull static FloatTuple 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)
      Specified by:
      size in interface BaseTuple<Float>
      Returns:
      The number of components this tuple has
    • isZero

      boolean isZero()
      Returns whether this tuple represents zero. (whether every component is zero)
      Returns:
      true if every component of this tuple is zero
    • isNaN

      boolean isNaN()
      Returns whether this tuple contains Float.NaN.
      Returns:
      true if at least one component of this tuple is not a number
      See Also:
    • isFinite

      boolean isFinite()
      Returns whether this tuple is finite.
      Returns:
      true if every component of this tuple is finite
      See Also:
    • isInfinite

      boolean isInfinite()
      Returns whether this tuple is infinite.
      Returns:
      true if at least one component of this tuple is infinite
      See Also:
    • contains

      boolean contains(float v)
      Checks if this tuple contains the provided value v.
      Parameters:
      v - The value of which to check for containment
      Returns:
      true if at least one component of this tuple is equal to the provided value v
    • containsAll

      boolean containsAll(@Nonnull Iterable<Float> i)
      Checks if this tuple contains multiple values.
      Parameters:
      i - The iterable object of which to check for containment
      Returns:
      true if this tuple contains every component of the iterable object
    • get

      float get(int i) throws IndexOutOfBoundsException
      Returns the ith component of this tuple.
      Parameters:
      i - The index of the component to get
      Returns:
      The ith component of this tuple
      Throws:
      IndexOutOfBoundsException - When the index i is out of bounds
    • map

      @Nonnull FloatTuple map(@Nonnull FloatUnaryOperator f)
      Applies the provided mapper function f to each component of this tuple, then returns a new tuple containing the return values of the function f.
      Parameters:
      f - The function of which to apply to each component of this tuple
      Returns:
      The resulting tuple
    • mapToObj

      @Nonnull <F> Tuple<F> mapToObj(@Nonnull FloatFunction<? extends F> f)
      Applies the provided mapper function f to each component of this tuple, then returns a new tuple containing the return values of the function f.
      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

      @Nonnull default FloatArray 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

      @Nonnull Stream<Float> 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

      @Nonnull List<Float> list()
      Returns an unmodifiable list containing the components of this tuple in their proper order.
      Specified by:
      list in interface BaseTuple<Float>
      Returns:
      The list representation of this tuple
      See Also:
    • boxed

      @Nonnull Tuple<Float> 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

      boolean equals(@Nullable Object obj)
      Checks for equality between this tuple and the provided object obj.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare to
      Returns:
      true if the other object is also a float tuple, and the number of components, the order of the components, and the components' values are all equal
    • toString

      @Nonnull String toString()
      Serializes this tuple into a string.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this tuple