com.raritantechnologies.utils.tree
Class TreeNodeComparator

java.lang.Object
  extended bycom.raritantechnologies.utils.tree.TreeNodeComparator
All Implemented Interfaces:
java.util.Comparator, IConfigurable

public class TreeNodeComparator
extends java.lang.Object
implements java.util.Comparator, IConfigurable

Comparator for TreeNode objects.

XML Configuration Template:
   <TreeNodeComparator  type="[ NAME | ID | PATH | ATTRIBUTE | CONTAINS_ATTRIBUTE | CONTAINS_RESULT ]"
                           compField="[ Attribute:attribute name | Result field ]"
                           compValue="[ value for exact match ]"
                           isNot="[ true|false(default) ]" >

     <Comparator class="[ class of IComparator ]" >

     </Comparator>

     <!-- Use a ResultMatcher if the tree node comparator uses a nested result -->
     <ResultMatcher class="[ class of IResultMatcher ]" >

     </ResultMatcher>

   </TreeNodeComparator>
 


Field Summary
static int ATTRIBUTE
           
static int CONTAINS_ATTRIBUTE
           
static int CONTAINS_RESULT
           
static int ID
           
static int NAME
           
static int PATH
           
 
Constructor Summary
TreeNodeComparator()
           
TreeNodeComparator(int compType)
           
TreeNodeComparator(java.lang.String attribute)
           
 
Method Summary
 int compare(java.lang.Object ob1, java.lang.Object ob2)
           
 boolean equals(java.lang.Object 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final int NAME
See Also:
Constant Field Values

ID

public static final int ID
See Also:
Constant Field Values

PATH

public static final int PATH
See Also:
Constant Field Values

ATTRIBUTE

public static final int ATTRIBUTE
See Also:
Constant Field Values

CONTAINS_ATTRIBUTE

public static final int CONTAINS_ATTRIBUTE
See Also:
Constant Field Values

CONTAINS_RESULT

public static final int CONTAINS_RESULT
See Also:
Constant Field Values
Constructor Detail

TreeNodeComparator

public TreeNodeComparator()

TreeNodeComparator

public TreeNodeComparator(int compType)

TreeNodeComparator

public TreeNodeComparator(java.lang.String attribute)
Method Detail

equals

public boolean equals(java.lang.Object object)
Specified by:
equals in interface java.util.Comparator

compare

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

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