public class LongIndexPair
extends java.lang.Object
long value, with an associated int index. Note
that, unlike Pair, this class does not implement
Map.Entry, because it deals with primitive values only.| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
int |
getIndex()
Getter for the index.
|
long |
getLongValue()
Getter for the
long value associated with an index. |
int |
hashCode()
Generates a hash code based on the hash codes of its primitive attributes.
|
static LongIndexPair |
of(long longValue,
int index)
Builds a new instance of this class, with the given
longValue value, and an associated
index. |
java.lang.String |
toString()
Returns a string representation of the object, containing the primitive attribute values of this object.
|
public static LongIndexPair of(long longValue, int index)
longValue value, and an associated
index.longValue - A long value to be paired with an associated index.index - An int index.public long getLongValue()
long value associated with an index.public int getIndex()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
long and index attributes are
equal.equals in class java.lang.Objectobj - The target object with which to compare the current instance.public java.lang.String toString()
toString in class java.lang.Object