Package it.unimi.dsi.fastutil.objects
Class ReferenceShortImmutablePair<K>
- java.lang.Object
-
- it.unimi.dsi.fastutil.objects.ReferenceShortImmutablePair<K>
-
- All Implemented Interfaces:
ReferenceShortPair<K>
,Pair<K,Short>
,Serializable
public class ReferenceShortImmutablePair<K> extends Object implements ReferenceShortPair<K>, Serializable
A type-specific immutablePair
; provides some additional methods that use polymorphism to avoid (un)boxing.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ReferenceShortImmutablePair(K left, short right)
Creates a new type-specific immutablePair
with given left and right value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
int
hashCode()
K
left()
Returns the left element of this pair.static <K> ReferenceShortImmutablePair<K>
of(K left, short right)
Returns a new type-specific immutablePair
with given left and right value.short
rightShort()
Returns the right element of this pair.String
toString()
Returns a string representation of this pair in the form <l,r>.-
Methods inherited from interface it.unimi.dsi.fastutil.objects.ReferenceShortPair
right, right, right, second, second, second, secondShort, value, value, value, valueShort
-
-
-
-
Method Detail
-
of
public static <K> ReferenceShortImmutablePair<K> of(K left, short right)
Returns a new type-specific immutablePair
with given left and right value.- Parameters:
left
- the left value.right
- the right value.- Implementation Notes:
- This factory method delegates to the constructor.
-
rightShort
public short rightShort()
Description copied from interface:ReferenceShortPair
Returns the right element of this pair.- Specified by:
rightShort
in interfaceReferenceShortPair<K>
- Returns:
- the right element of this pair.
-
-