public final class BooleanPair extends java.lang.Object implements java.io.Serializable, BooleanIndexable
This is similar to Pair
, but for raw boolean
values.
As these values are defined final, this class is also immutable.
BooleanIndexable.Base
Modifier and Type | Field and Description |
---|---|
boolean |
first
The first value of this pair.
|
boolean |
second
The second value of this pair.
|
EMPTY, SINGLE_FALSE, SINGLE_TRUE
EMPTY_BOOLEAN_ITERATOR
Constructor and Description |
---|
BooleanPair(boolean first,
boolean second)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
applyAsBooleans(BooleanFunction2<T> function)
Apply a 2-boolean function on this pair.
|
boolean |
equals(java.lang.Object o) |
boolean |
get(int index)
Get the element at the given index.
|
int |
hashCode() |
boolean |
operate(BooleanOperator2 operator)
Call an 2-boolean operator on this pair.
|
int |
size()
Get the size.
|
boolean |
test(BooleanPredicate2 predicate)
Call a 2-boolean predicate on this pair.
|
java.lang.String |
toString() |
Tuple2<java.lang.Boolean,java.lang.Boolean> |
toTuple()
Convert this into a tuple.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAllTo, addToArray, addToArray, asBase, asCollection, asIndexable, asList, booleanIterator, booleanIterator, compare, emptyIndexable, equal, equal, firstMatch, foldLeft, frozen, gyt, hash, headSet, indexes, init, initByIndex, intIndexes, isEmpty, iterator, lastMatch, listIterator, nextMatch, previousMatch, reverse, rotated, singleton, subSet, sybSet, tailSet, toArray, toList, toString, view, viewArray, viewArray, viewArray, viewByIndex, viewIndexable, viewIndexable, viewIndexable, viewList, viewList, viewList, withAppendedValue, withCachedHash, withExchangedValueAt, withInsertedValueAt, withRemovedValueAt, withSwappedValuesAt
and, containsBool, containsFalse, containsTrue, forEachBool, forEachBooleanFragile, forEachBoolFragile, or, xor
public final boolean first
public final boolean second
public BooleanPair(boolean first, boolean second)
first
- first value of pairsecond
- second value of pairpublic int size()
Sizeable
public boolean get(int index)
BooleanIndexable
get
in interface BooleanIndexable
index
- index between 0
and size() - 1
public <T> T applyAsBooleans(@NotNull BooleanFunction2<T> function)
public boolean operate(@NotNull BooleanOperator2 operator)
public boolean test(@NotNull BooleanPredicate2 predicate)
@NotNull public Tuple2<java.lang.Boolean,java.lang.Boolean> toTuple()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@NotNull public java.lang.String toString()
toString
in class java.lang.Object