Package org.cip4.jdflib.core
Class KElement.SingleXPathComparator
- java.lang.Object
-
- org.cip4.jdflib.core.KElement.SingleXPathComparator
-
- All Implemented Interfaces:
java.util.Comparator<KElement>
- Direct Known Subclasses:
KElement.MultiAttributeComparator,KElement.SingleAttributeComparator
- Enclosing class:
- KElement
public static class KElement.SingleXPathComparator extends java.lang.Object implements java.util.Comparator<KElement>
sorts according to the value of one attribute
if the attribute is numeric, compare numerically, else lexical comparison is done
-
-
Constructor Summary
Constructors Constructor Description SingleXPathComparator(java.lang.String xPath, boolean pInvert)if the attribute is numeric, compare numerically, else lexical comparison is doneSingleXPathComparator(java.lang.String xPath, boolean pInvert, boolean checkNumber, boolean caseSensitive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(KElement o1, KElement o2)booleanisCaseSensitive()booleanisCheckNumber()voidsetCaseSensitive(boolean caseSensitive)voidsetCheckNumber(boolean checkNumber)
-
-
-
Constructor Detail
-
SingleXPathComparator
public SingleXPathComparator(java.lang.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 comparingpInvert- if true, sort backwards
-
SingleXPathComparator
public SingleXPathComparator(java.lang.String xPath, boolean pInvert, boolean checkNumber, boolean caseSensitive)
-
-
Method Detail
-
compare
public int compare(KElement o1, KElement o2)
- Specified by:
comparein interfacejava.util.Comparator<KElement>- Parameters:
o1-o2-- Returns:
- See Also:
Comparator.compare(java.lang.Object, java.lang.Object)
-
isCheckNumber
public boolean isCheckNumber()
-
setCheckNumber
public void setCheckNumber(boolean checkNumber)
-
isCaseSensitive
public boolean isCaseSensitive()
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive)
-
-