org.cip4.jdflib.core
Class KElement.SingleXPathComparator

java.lang.Object
  extended by org.cip4.jdflib.core.KElement.SingleXPathComparator
All Implemented Interfaces:
Comparator<KElement>
Direct Known Subclasses:
KElement.SingleAttributeComparator
Enclosing class:
KElement

public static class KElement.SingleXPathComparator
extends Object
implements Comparator<KElement>

sorts according to the value of one attribute
if the attribute is numeric, compare numerically, else lexical comparison is done

Author:
prosirai

Constructor Summary
KElement.SingleXPathComparator(String xPath, boolean pInvert)
          if the attribute is numeric, compare numerically, else lexical comparison is done
 
Method Summary
 int compare(KElement o1, KElement o2)
           
 
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

KElement.SingleXPathComparator

public KElement.SingleXPathComparator(String xPath,
                                      boolean pInvert)
if the attribute is numeric, compare numerically, else lexical comparison is done

Parameters:
xPath - the xpath in the context of this element to use for comparing
pInvert - if true, sort backwards
Method Detail

compare

public int compare(KElement o1,
                   KElement o2)
Specified by:
compare in interface Comparator<KElement>
Parameters:
o1 -
o2 -
Returns:
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)


Copyright © 2013. All Rights Reserved.