Package org.gvsig.utils
Class StringComparator
java.lang.Object
org.gvsig.utils.StringComparator
- All Implemented Interfaces:
Comparator
Compares two chain of characters alphabetically
- Author:
- Fernando González Cortés, Pablo Piqueras Bartolomé
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassRepresents the information needed by StringComparator for use or not locale-sensitive String comparison-rules in the compare method -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets an object with the information for use the locale rules in comparation between strings.booleanReturns if the comparator is sensitive to small and big lettersvoidsetCaseSensitive(boolean b) Establece la sensibilidad del comparador a las mayusculas y minusculasvoidsetLocaleRules(StringComparator.LocaleRules locRules) Sets an object with the information for use the locale rules in comparation between strings.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
-
Field Details
-
caseSensitive
protected boolean caseSensitive -
localeRules
-
-
Constructor Details
-
StringComparator
public StringComparator()
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator- See Also:
-
isCaseSensitive
public boolean isCaseSensitive()Returns if the comparator is sensitive to small and big letters- Returns:
-
setCaseSensitive
public void setCaseSensitive(boolean b) Establece la sensibilidad del comparador a las mayusculas y minusculas- Parameters:
b-
-
getLocaleRules
Gets an object with the information for use the locale rules in comparation between strings.
- A boolean value -> if want or not use the locale rules
- A reference to the locale rules
- Returns:
- @see LocaleRules
-
setLocaleRules
Sets an object with the information for use the locale rules in comparation between strings.
- A boolean value -> if want or not use the locale rules
- A reference to the locale rules
-