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:
java.util.Comparator<KElement>
- Enclosing class:
- KElement
public static class KElement.SingleAttributeComparator extends KElement.SingleXPathComparator
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 SingleAttributeComparator(java.lang.String pAttName, boolean pInvert)if the attribute is numeric, compare numerically, else lexical comparison is doneSingleAttributeComparator(java.lang.String pAttName, boolean pInvert, boolean checkNumber, boolean caseSensitive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(KElement o1, KElement o2)-
Methods inherited from class org.cip4.jdflib.core.KElement.SingleXPathComparator
isCaseSensitive, isCheckNumber, setCaseSensitive, setCheckNumber
-
-
-
-
Constructor Detail
-
SingleAttributeComparator
public SingleAttributeComparator(java.lang.String pAttName, boolean pInvert)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(java.lang.String pAttName, boolean pInvert, boolean checkNumber, boolean caseSensitive)
-
-
Method Detail
-
compare
public int compare(KElement o1, KElement o2)
- Specified by:
comparein interfacejava.util.Comparator<KElement>- Overrides:
comparein classKElement.SingleXPathComparator- Parameters:
o1-o2-- Returns:
- See Also:
Comparator.compare(java.lang.Object, java.lang.Object)
-
-