Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 7 (11.1.7)

E22562-07

oracle.apps.fnd.applcore.globalSearch.ui
Class ResultComparator

java.lang.Object
  extended by 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)
          Construct this comparitor.
 
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
 

Constructor Detail

ResultComparator

public ResultComparator(java.lang.String attributeName,
                        boolean asc)
Construct this comparitor.

Parameters:
attributeName - name of attribute to compare.
asc - are we comparing in ascending order or descending.
Method Detail

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 compared
object2 - 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)

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 7 (11.1.7)

E22562-07

Copyright © 2013 Oracle. All Rights Reserved.