public class LongObjectMutablePair<V> extends java.lang.Object implements LongObjectPair<V>, java.io.Serializable
Pair
; provides some additional methods that use polymorphism to avoid (un)boxing.Constructor and Description |
---|
LongObjectMutablePair(long left,
V right)
Creates a new type-specific mutable
Pair with given left and right value. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
LongObjectMutablePair<V> |
left(long l)
Sets the left element of this pair (optional operation).
|
long |
leftLong()
Returns the left element of this pair.
|
static <V> LongObjectMutablePair<V> |
of(long left,
V right)
Returns a new type-specific mutable
Pair with given left and right value. |
V |
right()
Returns the right element of this pair.
|
LongObjectMutablePair<V> |
right(V r)
Sets the right element of this pair (optional operation).
|
java.lang.String |
toString()
Returns a string representation of this pair in the form <l,r>.
|
public static <V> LongObjectMutablePair<V> of(long left, V right)
Pair
with given left and right value.public long leftLong()
LongObjectPair
leftLong
in interface LongObjectPair<V>
public LongObjectMutablePair<V> left(long l)
LongObjectPair
left
in interface LongObjectPair<V>
l
- a new value for the left element.public V right()
Pair
public LongObjectMutablePair<V> right(V r)
Pair
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