public class ObjectIndexPair<T>
extends java.lang.Object
int index. Note that,
unlike Pair, this class does not implement Map.Entry,
because it deals with a primitive index value.| 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.
|
T |
getObject()
Getter for an object of type <T> associated with an index.
|
int |
hashCode()
Generates a hash code based on the hash codes of its attributes.
|
static <T> ObjectIndexPair<T> |
of(T object,
int index)
Builds a new instance of this class, with the given
object and index values. |
java.lang.String |
toString()
Returns a string representation of the object, containing the object of type <T> and
int index
attributes of this object. |
public static <T> ObjectIndexPair<T> of(T object, int index)
object and index values.T - The type of the object to be paired with an int index.object - An object of type <T> to be paired with an associated index.index - An int index.public T getObject()
public int getIndex()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
int 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()
int index
attributes of this object.toString in class java.lang.Object