public class ShortLongImmutablePair extends java.lang.Object implements ShortLongPair, java.io.Serializable
Pair
; provides some additional methods that use polymorphism to avoid (un)boxing.Constructor and Description |
---|
ShortLongImmutablePair(short left,
long right)
Creates a new type-specific immutable
Pair with given left and right value. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
short |
leftShort()
Returns the left element of this pair.
|
static ShortLongImmutablePair |
of(short left,
long right)
Returns a new type-specific immutable
Pair with given left and right value. |
long |
rightLong()
Returns the right element of this pair.
|
java.lang.String |
toString()
Returns a string representation of this pair in the form <l,r>.
|
public ShortLongImmutablePair(short left, long right)
Pair
with given left and right value.left
- the left value.right
- the right value.public static ShortLongImmutablePair of(short left, long right)
Pair
with given left and right value.of
in interface Pair<java.lang.Short,java.lang.Long>
of
in interface ShortLongPair
left
- the left value.right
- the right value.public short leftShort()
ShortLongPair
leftShort
in interface ShortLongPair
public long rightLong()
ShortLongPair
rightLong
in interface ShortLongPair
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object