Package com.automation_pros.odva.util
Class AlphanumComparator
- java.lang.Object
-
- com.automation_pros.odva.util.AlphanumComparator
-
- All Implemented Interfaces:
java.util.Comparator<java.lang.String>
public class AlphanumComparator extends java.lang.Object implements java.util.Comparator<java.lang.String>
This is an updated version with enhancements made by Daniel Migowski, Andre Bogus, and David Koelle. Updated by David Koelle in 2017.To use this class: Use the static "sort" method from the java.util.Collections class: Collections.sort(your list, new AlphanumComparator());
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
doCaseSensitive
-
Constructor Summary
Constructors Constructor Description AlphanumComparator()
AlphanumComparator(boolean caseSensitive)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(java.lang.String s1, java.lang.String s2)
static void
main(java.lang.String[] args)
Shows an example of how the comparator works.
-
-
-
Method Detail
-
compare
public int compare(java.lang.String s1, java.lang.String s2)
- Specified by:
compare
in interfacejava.util.Comparator<java.lang.String>
-
main
public static void main(java.lang.String[] args)
Shows an example of how the comparator works. Feel free to delete this in your own code!
-
-