Package it.unimi.dsi.fastutil.shorts
Class ShortLongImmutablePair
- java.lang.Object
-
- it.unimi.dsi.fastutil.shorts.ShortLongImmutablePair
-
- All Implemented Interfaces:
Pair<Short,Long>,ShortLongPair,Serializable
public class ShortLongImmutablePair extends Object implements ShortLongPair, 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 ShortLongImmutablePair(short left, long right)Creates a new type-specific immutablePairwith given left and right value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)inthashCode()shortleftShort()Returns the left element of this pair.static ShortLongImmutablePairof(short left, long right)Returns a new type-specific immutablePairwith given left and right value.longrightLong()Returns the right element of this pair.StringtoString()Returns a string representation of this pair in the form <l,r>.
-
-
-
Constructor Detail
-
ShortLongImmutablePair
public ShortLongImmutablePair(short left, long right)Creates a new type-specific immutablePairwith given left and right value.- Parameters:
left- the left value.right- the right value.
-
-
Method Detail
-
of
public static ShortLongImmutablePair of(short left, long right)
Returns a new type-specific immutablePairwith given left and right value.- Parameters:
left- the left value.right- the right value.- Implementation Notes:
- This factory method delegates to the constructor.
-
leftShort
public short leftShort()
Description copied from interface:ShortLongPairReturns the left element of this pair.- Specified by:
leftShortin interfaceShortLongPair- Returns:
- the left element of this pair.
-
rightLong
public long rightLong()
Description copied from interface:ShortLongPairReturns the right element of this pair.- Specified by:
rightLongin interfaceShortLongPair- Returns:
- the right element of this pair.
-
-