public final class FloatPair extends java.lang.Object implements java.io.Serializable, FloatIndexable
This is similar to Pair, but for raw float values.
As these values are defined final, this class is also immutable.
FloatIndexable.Base| Modifier and Type | Field and Description |
|---|---|
float |
first
The first value of this pair.
|
float |
second
The second value of this pair.
|
EMPTY, SINGLE_0EMPTY_FLOAT_ITERATOR| Constructor and Description |
|---|
FloatPair(float first,
float second)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
applyAsFloats(FloatFunction2<T> function)
Apply a 2-float function on this pair.
|
boolean |
equals(java.lang.Object o) |
float |
get(int index)
Get the element at the given index.
|
int |
hashCode() |
float |
operate(FloatOperator2 operator)
Call an 2-float operator on this pair.
|
int |
size()
Get the size.
|
FloatPair |
swapped()
Get this pair with swapped values.
|
boolean |
test(FloatPredicate2 predicate)
Call a 2-float predicate on this pair.
|
DoublePair |
toDoublePair()
Convert this pair of
floats into a pair of doubles. |
java.lang.String |
toString() |
Tuple2<java.lang.Float,java.lang.Float> |
toTuple()
Convert this into a tuple.
|
FloatPair |
withFirst(float first)
Get this pair with a different first value.
|
FloatPair |
withSecond(float second)
Get this pair with a different first value.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAllTo, addToArray, addToArray, asBase, asCollection, asDoubleIndexable, asIndexable, asList, based, binarySearch, binarySearch, compare, doubleIterator, emptyIndexable, equal, equal, equal, equalStandard, firstMatch, floatIterator, floatIterator, foldLeft, frozen, getMod, gyt, hash, headSet, indexes, init, initByIndex, intIndexes, isEmpty, isOrdered, isStrictlyOrdered, iterator, lastMatch, listIterator, nextMatch, ordered, ordered, previousMatch, reverse, rotated, singleton, subSet, sybSet, tailSet, toArray, toList, toString, view, viewArray, viewArray, viewArray, viewAsBoolean, viewAsByte, viewAsDouble, viewAsInt, viewAsLong, viewAsShort, viewByIndex, viewIndexable, viewIndexable, viewIndexable, viewList, viewList, viewList, viewNumberArray, viewOp, withAppendedValue, withCachedHash, withExchangedValueAt, withInsertedValueAt, withRemovedValueAt, withSwappedValuesAtasDoubleIterable, containsFloat, containsFloat, forEachFloat, forEachFloatFragilepublic final float first
public final float second
public FloatPair(float first,
float second)
first - first value of pairsecond - second value of pair@NotNull public DoublePair toDoublePair()
floats into a pair of doubles.@NotNull public FloatPair withFirst(float first)
first - new first valuefirst value,
and the second value of this pair@NotNull public FloatPair withSecond(float second)
second - new second valuefirst value of this pair,
and the given second valuepublic int size()
Sizeablepublic float get(int index)
FloatIndexableget in interface FloatIndexableindex - index between 0 and size() - 1public <T> T applyAsFloats(@NotNull FloatFunction2<T> function)
public float operate(@NotNull FloatOperator2 operator)
public boolean test(@NotNull FloatPredicate2 predicate)
@NotNull public Tuple2<java.lang.Float,java.lang.Float> toTuple()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object@NotNull public java.lang.String toString()
toString in class java.lang.Object