org.onebusaway.utility.collections
Class Indexed<T>
java.lang.Object
org.onebusaway.utility.collections.Indexed<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
- Serializable, Comparable<Indexed<T>>
public class Indexed<T>
- extends Object
- implements Comparable<Indexed<T>>, Serializable
A wrapper class for an object that add an integer index parameter that can be
used to apply a Comparable
sort order to an arbitrary type.
- Author:
- bdferris
- See Also:
- Serialized Form
Constructor Summary |
Indexed(T value,
int index)
|
Indexed
public Indexed(T value,
int index)
create
public static <TO> Indexed<TO> create(TO value,
int index)
getValue
public T getValue()
getIndex
public int getIndex()
compareTo
public int compareTo(Indexed<T> o)
- Specified by:
compareTo
in interface Comparable<Indexed<T>>
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2012 OneBusAway. All Rights Reserved.