public class IntIndexPair
extends java.lang.Object
int 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.
|
int |
getIntValue()
Getter for the
int value associated with an index. |
int |
hashCode()
Generates a hash code based on the hash codes of its primitive attributes.
|
static IntIndexPair |
of(int intValue,
int index)
Builds a new instance of this class, with the given
intValue 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 IntIndexPair of(int intValue, int index)
intValue value, and an associated
index.intValue - An int value to be paired with an associated index.index - An int index.public int getIntValue()
int value associated with an index.public int getIndex()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
int 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