Package org.cip4.jdflib.core
Class KElement.SingleXPathComparator
java.lang.Object
org.cip4.jdflib.core.KElement.SingleXPathComparator
- All Implemented Interfaces:
Comparator<KElement>
- Direct Known Subclasses:
KElement.MultiAttributeComparator,KElement.SingleAttributeComparator
- 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
ConstructorsConstructorDescriptionSingleXPathComparator(String xPath, boolean pInvert) if the attribute is numeric, compare numerically, else lexical comparison is doneSingleXPathComparator(String xPath, boolean pInvert, boolean checkNumber, boolean caseSensitive) -
Method Summary
Modifier and TypeMethodDescriptionintbooleanbooleanvoidsetCaseSensitive(boolean caseSensitive) voidsetCheckNumber(boolean checkNumber) Methods 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
-
SingleXPathComparator
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 comparingpInvert- if true, sort backwards
-
SingleXPathComparator
public SingleXPathComparator(String xPath, boolean pInvert, boolean checkNumber, boolean caseSensitive)
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<KElement>- Parameters:
o1-o2-- Returns:
- See Also:
-
isCheckNumber
public boolean isCheckNumber() -
setCheckNumber
public void setCheckNumber(boolean checkNumber) -
isCaseSensitive
public boolean isCaseSensitive() -
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive)
-