public interface LPair<T1,T2> extends LTuple<Object>, LSingle<T1>, Map.Entry<T2,T1>
Exact equivalent of input parameters used in LBiConsumer.
| Modifier and Type | Interface and Description |
|---|---|
static class |
LPair.AbstractPair<T1,T2> |
static interface |
LPair.ComparablePair<T1 extends Comparable<T1>,T2 extends Comparable<T2>> |
static class |
LPair.ImmCompPair<T1 extends Comparable<T1>,T2 extends Comparable<T2>>
Immutable, comparable tuple.
|
static class |
LPair.ImmPair<T1,T2>
Immutable, non-comparable tuple.
|
static class |
LPair.MutCompPair<T1 extends Comparable<T1>,T2 extends Comparable<T2>>
Mutable, comparable tuple.
|
static class |
LPair.MutPair<T1,T2>
Mutable, non-comparable tuple.
|
LSingle.AbstractSingle<T>, LSingle.ComparableSingle<T extends Comparable<T>>, LSingle.ImmCompSingle<T extends Comparable<T>>, LSingle.ImmSingle<T>, LSingle.MutCompSingle<T extends Comparable<T>>, LSingle.MutSingle<T>LTuple.Void| Modifier and Type | Field and Description |
|---|---|
static int |
SIZE |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
argEquals(LPair the,
Object that)
Static equals() implementation that takes two tuples asnd checks if they are equal.
|
static <T1,T2> boolean |
argEquals(T1 a1,
T2 a2,
T1 b1,
T2 b2)
Static equals() implementation that takes same arguments (doubled) as fields of the LPair and checks if all values are equal.
|
static <T1,T2> int |
argHashCode(T1 a1,
T2 a2)
Static hashCode() implementation method that takes same arguments as fields of the LPair and calculates hash from it.
|
T1 |
first() |
default Object |
get(int index) |
default T2 |
getKey()
Returns key as Entry.key()
|
default T1 |
getValue()
Returns value as Entry.value().
|
default Iterator<Object> |
iterator() |
T2 |
second() |
default T1 |
setValue(T1 value) |
default int |
size()
Tuple size
|
default T1 |
value() |
argHashCodecomparingByKey, comparingByKey, comparingByValue, comparingByValue, equals, hashCodestatic final int SIZE
T2 second()
default int size()
Tuple size
default T2 getKey()
Returns key as Entry.key()
default T1 getValue()
Returns value as Entry.value(). ‘Value’ is assigned to first tuple element.
static <T1,T2> int argHashCode(T1 a1,
T2 a2)
Static hashCode() implementation method that takes same arguments as fields of the LPair and calculates hash from it.
static <T1,T2> boolean argEquals(T1 a1,
T2 a2,
T1 b1,
T2 b2)
Static equals() implementation that takes same arguments (doubled) as fields of the LPair and checks if all values are equal.
static boolean argEquals(LPair the, Object that)
Static equals() implementation that takes two tuples asnd checks if they are equal.
Tuples are considered equal if are implementing same interface and their tuple values are equal regardless of the implementing class.
Copyright © 2019. All rights reserved.