org.apache.xml.utils
Class StringComparable

java.lang.Object
  extended by org.apache.xml.utils.StringComparable
All Implemented Interfaces:
java.lang.Comparable

public class StringComparable
extends java.lang.Object
implements java.lang.Comparable

International friendly string comparison with case-order


Field Summary
static int LOWER_CASE
           
private  java.lang.String m_caseOrder
           
private  java.text.RuleBasedCollator m_collator
           
private  java.util.Locale m_locale
           
private  int m_mask
           
private  java.lang.String m_text
           
static int UNKNOWN_CASE
           
static int UPPER_CASE
           
 
Constructor Summary
StringComparable(java.lang.String text, java.util.Locale locale, java.text.Collator collator, java.lang.String caseOrder)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
private  int getCaseDiff(java.lang.String text, java.lang.String pattern)
           
static java.lang.Comparable getComparator(java.lang.String text, java.util.Locale locale, java.text.Collator collator, java.lang.String caseOrder)
           
private  int getElement(int maxStrengthElement)
           
private  int[] getFirstCaseDiff(java.lang.String text, java.lang.String pattern, java.util.Locale locale)
           
private static int getMask(int strength)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_CASE

public static final int UNKNOWN_CASE
See Also:
Constant Field Values

UPPER_CASE

public static final int UPPER_CASE
See Also:
Constant Field Values

LOWER_CASE

public static final int LOWER_CASE
See Also:
Constant Field Values

m_text

private java.lang.String m_text

m_locale

private java.util.Locale m_locale

m_collator

private java.text.RuleBasedCollator m_collator

m_caseOrder

private java.lang.String m_caseOrder

m_mask

private int m_mask
Constructor Detail

StringComparable

public StringComparable(java.lang.String text,
                        java.util.Locale locale,
                        java.text.Collator collator,
                        java.lang.String caseOrder)
Method Detail

getComparator

public static final java.lang.Comparable getComparator(java.lang.String text,
                                                       java.util.Locale locale,
                                                       java.text.Collator collator,
                                                       java.lang.String caseOrder)

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

getCaseDiff

private final int getCaseDiff(java.lang.String text,
                              java.lang.String pattern)

getFirstCaseDiff

private final int[] getFirstCaseDiff(java.lang.String text,
                                     java.lang.String pattern,
                                     java.util.Locale locale)

getMask

private static final int getMask(int strength)

getElement

private final int getElement(int maxStrengthElement)