oracle.apps.fnd.applcore.globalSearch.ui
Class ResultComparator
java.lang.Object
oracle.apps.fnd.applcore.globalSearch.ui.ResultComparator
- All Implemented Interfaces:
- java.io.Serializable, java.util.Comparator
public final class ResultComparator
- extends java.lang.Object
- implements java.util.Comparator, java.io.Serializable
A comparator to compare 2 SearchResultItems.
A SearchResultItem comes before another if it's defined attribute compares
less than the another's. In the case where one has an attribute and the other
does not, the one with the attribute wins.
If neither has the attribute, then a descending relevance (default)
comparison is done.
- See Also:
- Serialized Form
Constructor Summary |
ResultComparator(java.lang.String attributeName,
boolean asc)
|
Method Summary |
int |
compare(java.lang.Object object1,
java.lang.Object object2)
Compares two SearchResultItem objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
ResultComparator
public ResultComparator(java.lang.String attributeName,
boolean asc)
compare
public int compare(java.lang.Object object1,
java.lang.Object object2)
- Compares two SearchResultItem objects.
- Specified by:
compare
in interface java.util.Comparator
- Parameters:
object1
- the first result item to be comparedobject2
- the second result item to be compared
- Returns:
- < 0 if first result item comes alphabetically before second result item (ascending) or has
been updated older than the second tag (for ascending) or if first tag
comes alphabetically after second tag or has been updated more recently
than the second tag (for descending); 0 if first tag is the same as
second tag or both has the same last-use-date; >0 if first tag comes
alphabetically after second tag or has been updated more recently
that the second tag (for ascending) or if first tag come alphabetically
before second tag or has been updated older than the second tag
(for descending)
Copyright © 2012 Oracle. All Rights Reserved.