Package it.unimi.dsi.fastutil.longs
Class LongObjectImmutablePair<V>
- java.lang.Object
-
- it.unimi.dsi.fastutil.longs.LongObjectImmutablePair<V>
-
- All Implemented Interfaces:
LongObjectPair<V>
,Pair<Long,V>
,Serializable
public class LongObjectImmutablePair<V> extends Object implements LongObjectPair<V>, 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 LongObjectImmutablePair(long left, V 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()
long
leftLong()
Returns the left element of this pair.static <V> LongObjectImmutablePair<V>
of(long left, V right)
Returns a new type-specific immutablePair
with given left and right value.V
right()
Returns the right element of this pair.String
toString()
Returns a string representation of this pair in the form <l,r>.
-
-
-
Method Detail
-
of
public static <V> LongObjectImmutablePair<V> of(long left, V 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.
-
leftLong
public long leftLong()
Description copied from interface:LongObjectPair
Returns the left element of this pair.- Specified by:
leftLong
in interfaceLongObjectPair<V>
- Returns:
- the left element of this pair.
-
right
public V right()
Description copied from interface:Pair
Returns the right element of this pair.
-
-