Purpose: A helper class for sorting index/object pairs.
Responsibilities:
Allows to sort a list of index/object pairs either directly
or with Collections.sort(List<IndexedObject>) - using IndexedObject.compareTo;
or with Collections.sort(List<IndexedObject>, Comparator<IndexedObject>) - using custom-defined Comparator<IndexedObject>.
Collections, Comparator, OrderedListContainerPolicy
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(IndexedObject
the object to be compared. anotherIndexedObject)Implements java. |
| public Integer | |
| public Object | |
| public void | |
| public void | |
| public String |
| IndexedObject | back to summary |
|---|---|
| public IndexedObject(Integer index, Object object) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(IndexedObject anotherIndexedObject) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| getIndex | back to summary |
|---|---|
| public Integer getIndex() | |
| getObject | back to summary |
|---|---|
| public Object getObject() | |
| setIndex | back to summary |
|---|---|
| public void setIndex(Integer index) | |
| setObject | back to summary |
|---|---|
| public void setObject(Object object) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |