Known Direct Subclasses
|
Class Overview
A Comparator which includes a helper function for comparing two Objects
which are likely to be keys in the specified Map.
Summary
Constants |
boolean |
SELECT_BEST |
The best Object (e.g., DataFlavor) will be the last in sequence. |
boolean |
SELECT_WORST |
The best Object (e.g., DataFlavor) will be the first in sequence. |
Fields |
protected
final
boolean |
order |
|
Protected Methods |
static
int
|
compareIndices(Map indexMap, Object obj1, Object obj2, Integer fallbackIndex)
Helper method to compare two objects by their Integer indices in the
given map.
|
static
int
|
compareLongs(Map indexMap, Object obj1, Object obj2, Long fallbackIndex)
Helper method to compare two objects by their Long indices in the
given map.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.util.Comparator
abstract
int
|
compare(T o1, T o2)
Compares its two arguments for order.
|
abstract
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this
comparator.
|
|
Constants
public
static
final
boolean
SELECT_BEST
The best Object (e.g., DataFlavor) will be the last in sequence.
Constant Value:
true
public
static
final
boolean
SELECT_WORST
The best Object (e.g., DataFlavor) will be the first in sequence.
Constant Value:
false
Fields
protected
final
boolean
order
Public Constructors
public
DataTransferer.IndexedComparator
()
public
DataTransferer.IndexedComparator
(boolean order)
Protected Methods
protected
static
int
compareIndices
(Map indexMap, Object obj1, Object obj2, Integer fallbackIndex)
Helper method to compare two objects by their Integer indices in the
given map. If the map doesn't contain an entry for either of the
objects, the fallback index will be used for the object instead.
Parameters
indexMap
| the map which maps objects into Integer indexes. |
obj1
| the first object to be compared. |
obj2
| the second object to be compared. |
fallbackIndex
| the Integer to be used as a fallback index. |
Returns
- a negative integer, zero, or a positive integer as the
first object is mapped to a less, equal to, or greater
index than the second.
protected
static
int
compareLongs
(Map indexMap, Object obj1, Object obj2, Long fallbackIndex)
Helper method to compare two objects by their Long indices in the
given map. If the map doesn't contain an entry for either of the
objects, the fallback index will be used for the object instead.
Parameters
indexMap
| the map which maps objects into Long indexes. |
obj1
| the first object to be compared. |
obj2
| the second object to be compared. |
fallbackIndex
| the Long to be used as a fallback index. |
Returns
- a negative integer, zero, or a positive integer as the
first object is mapped to a less, equal to, or greater
index than the second.