Class OSXCollator
java.lang.Object
java.text.Collator
org.monte.media.imgseq.OSXCollator
- All Implemented Interfaces:
Cloneable,Comparator<Object>
The OSXCollator strives to match the collation rules used by the Mac OS X
Finder and of Mac OS X file dialogs.
If we wanted to match the OS X collation rules exactly, we would have to implement the rules for all languages supported by Mac OS X and Java. To reduce the amount of work needed for implementing these rules, the OSXCollator changes the collation rules returned by java.text.Collator.getInstance() to do the following:
- Space characters are treated as primary collation differences
- Hyphen characters are treated as primary collation differences
- Sequence of digits (characters '0' through '9') is treated as a single collation object. The current implementation supports sequences of up to 999 characters length.
- Author:
- Werner Randelshofer
-
Field Summary
Fields inherited from class java.text.Collator
CANONICAL_DECOMPOSITION, FULL_DECOMPOSITION, IDENTICAL, NO_DECOMPOSITION, PRIMARY, SECONDARY, TERTIARY -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.text.Collator
clone, compare, equals, getAvailableLocales, getDecomposition, getInstance, getInstance, getStrength, setDecomposition, setStrengthMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
OSXCollator
public OSXCollator()Creates a new instance. -
OSXCollator
-
-
Method Details
-
compare
-
getCollationKey
- Specified by:
getCollationKeyin classCollator
-
equals
-
hashCode
-