Package org.cip4.jdflib.core
Class KElement.SingleAttributeComparator
java.lang.Object
org.cip4.jdflib.core.KElement.SingleXPathComparator
org.cip4.jdflib.core.KElement.SingleAttributeComparator
- All Implemented Interfaces:
Comparator<KElement>
- Enclosing class:
- KElement
sorts according to the value of one attribute
if the attribute is numeric, compare numerically, else lexical comparison is done
if the attribute is numeric, compare numerically, else lexical comparison is done
-
Constructor Summary
ConstructorsConstructorDescriptionSingleAttributeComparator(String pAttName, boolean pInvert) if the attribute is numeric, compare numerically, else lexical comparison is doneSingleAttributeComparator(String pAttName, boolean pInvert, boolean checkNumber, boolean caseSensitive) -
Method Summary
Methods inherited from class org.cip4.jdflib.core.KElement.SingleXPathComparator
isCaseSensitive, isCheckNumber, setCaseSensitive, setCheckNumberMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
SingleAttributeComparator
if the attribute is numeric, compare numerically, else lexical comparison is done- Parameters:
pAttName- the attribute to use for comparingpInvert- if true, sort backwards
-
SingleAttributeComparator
public SingleAttributeComparator(String pAttName, boolean pInvert, boolean checkNumber, boolean caseSensitive)
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<KElement>- Overrides:
comparein classKElement.SingleXPathComparator- Parameters:
o1-o2-- Returns:
- See Also:
-