com.raritantechnologies.searchApp.resultComparators
Class CompositeResultComparator

java.lang.Object
  extended bycom.raritantechnologies.searchApp.resultComparators.CompositeResultComparator
All Implemented Interfaces:
java.util.Comparator, IConfigurable, IResultComparator

public class CompositeResultComparator
extends java.lang.Object
implements IResultComparator

Enables a tiered comparison: returns the value of the first nested IResultComparator that detects a difference between two IResult objects.

XML Configuration Template:
   <ResultComparator class="com.raritantechnologies.searchApp.resultComparators.CompositeResultComparator" >
     <!-- Two or more nested ResultComparators: -->
     <ResultComparator class="[ class of com.raritantechnologies.searchApp.IResultComparator ]" >

     </ResultComparator>

     <ResultComparator class="[ class of com.raritantechnologies.searchApp.IResultComparator ]" >

     </ResultComparator>

     <!-- etc . . . -->

   </ResultComparator>
 


Field Summary
 
Fields inherited from interface com.raritantechnologies.searchApp.IResultComparator
TEMPLATE
 
Constructor Summary
CompositeResultComparator()
           
 
Method Summary
 int compare(IResult res1, IResult res2)
           
 int compare(java.lang.Object obj1, java.lang.Object obj2)
           
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void setContext(java.util.Map parameterMap)
           
 
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

CompositeResultComparator

public CompositeResultComparator()
Method Detail

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
Specified by:
compare in interface java.util.Comparator

compare

public int compare(IResult res1,
                   IResult res2)
Specified by:
compare in interface IResultComparator

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IResultComparator

setContext

public void setContext(java.util.Map parameterMap)
Specified by:
setContext in interface IResultComparator

getConfigurationXML

public java.lang.String getConfigurationXML()

getConfigurationXML

public java.lang.String getConfigurationXML(java.lang.String configurationTemplate)