com.raritantechnologies.utils.comparators
Class ComparatorContainer

java.lang.Object
  extended bycom.raritantechnologies.utils.comparators.ComparatorContainer
All Implemented Interfaces:
IConfigurable

public class ComparatorContainer
extends java.lang.Object
implements IConfigurable

Wraps a configurable object and a configurable comparator. Its getConfigurable( Object ) method returns the contained configurable object if the comparator matches the passed object.

XML Configuration Template:
   <Comparator class="com.raritantechnologies.utils.comparators.ComparatorContainer" >

      <!-- Comparator used to compare object passed to getConfigurable method. -->
      <Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >

      </Comparator>

      <Object class="[ class of IConfigurable ]" >
          <!-- configuration parameters of IConfigurable object -->
      </Object>

   </Comparator>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Constructor Summary
ComparatorContainer()
           
ComparatorContainer(IComparator comp, IConfigurable obj)
           
 
Method Summary
 IConfigurable getConfigurable(java.lang.Object compareTo)
          returns the contained configurable object if the comparator matches the passed object.
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComparatorContainer

public ComparatorContainer()

ComparatorContainer

public ComparatorContainer(IComparator comp,
                           IConfigurable obj)
Method Detail

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 IConfigurable

getConfigurable

public IConfigurable getConfigurable(java.lang.Object compareTo)
returns the contained configurable object if the comparator matches the passed object.