com.programix.collections
Class GeneralStringComparator
java.lang.Object
com.programix.collections.GeneralStringComparator
- All Implemented Interfaces:
- Comparator<String>
public final class GeneralStringComparator
- extends Object
- implements Comparator<String>
Comparator that can be used to compare String's in
many different ways. Instances are immutable (everything must be
specified during construction).
- Author:
- Paul Hyde
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GeneralStringComparator
public GeneralStringComparator(GeneralStringComparator.CharSort charSort,
GeneralStringComparator.NullTreatment nullTreatment,
GeneralStringComparator.LengthTreatment lengthTreatment,
boolean trimBeforeCompare)
GeneralStringComparator
public GeneralStringComparator()
- Defaults to case insensitive ascending, null less than all,
no special length treatment, and all strings trimmed before
comparing.
Equivalent to:
this(CharSort.CASE_INSENSITIVE_ASC,
NullTreatment.LESS_THAN_ALL,
LengthTreatment.NONE,
true);
getCharSort
public GeneralStringComparator.CharSort getCharSort()
getLengthTreatment
public GeneralStringComparator.LengthTreatment getLengthTreatment()
getNullTreatment
public GeneralStringComparator.NullTreatment getNullTreatment()
isTrimBeforeCompare
public boolean isTrimBeforeCompare()
compare
public int compare(String obj1,
String obj2)
- Specified by:
compare in interface Comparator<String>
Copyright © 2001-2009
Programix Incorporated.
All rights reserved.
ProgramixGenericLib is free
and is
OSI Certified
Open Source Software under the BSD
license.