APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.utils

public Class StringComparable

extends Object
implements Comparable<StringComparable>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Imports
java.text.CollationElementIterator, .Collator, .RuleBasedCollator, java.util.Locale

International friendly string comparison with case-order
Author
Igor Hersht, [email protected]

Field Summary

Modifier and TypeField and Description
public static final int
private String
private RuleBasedCollator
private Locale
private int
private String
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public
StringComparable(final String text, final Locale locale, final Collator collator, final String caseOrder)

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(StringComparable o)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

private final int
getCaseDiff(final String text, final String pattern)

public static final Comparable<T>
getComparator(final String text, final Locale locale, final Collator collator, final String caseOrder)

private final int
getElement(int maxStrengthElement)

private final int[]
getFirstCaseDiff(final String text, final String pattern, final Locale locale)

private static final int
getMask(final int strength)

public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

LOWER_CASEback to summary
public static final int LOWER_CASE
m_caseOrderback to summary
private String m_caseOrder
m_collatorback to summary
private RuleBasedCollator m_collator
m_localeback to summary
private Locale m_locale
m_maskback to summary
private int m_mask
m_textback to summary
private String m_text
UNKNOWN_CASEback to summary
public static final int UNKNOWN_CASE
UPPER_CASEback to summary
public static final int UPPER_CASE

Constructor Detail

StringComparableback to summary
public StringComparable(final String text, final Locale locale, final Collator collator, final String caseOrder)

Method Detail

compareToback to summary
public int compareTo(StringComparable o)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

getCaseDiffback to summary
private final int getCaseDiff(final String text, final String pattern)
getComparatorback to summary
public static final Comparable<T> getComparator(final String text, final Locale locale, final Collator collator, final String caseOrder)
Annotations
@SuppressWarnings:rawtypes
getElementback to summary
private final int getElement(int maxStrengthElement)
getFirstCaseDiffback to summary
private final int[] getFirstCaseDiff(final String text, final String pattern, final Locale locale)
getMaskback to summary
private static final int getMask(final int strength)
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.