net.sf.saxon.sort

Class UppercaseFirstComparer

public class UppercaseFirstComparer extends Object implements Comparator, Serializable

A Comparer used for comparing strings, with upper case collated before lower case if the strings are otherwise equal. This is implemented as a wrapper around a collator that compares the strings ignoring case.

Author: Michael H. Kay

Constructor Summary
UppercaseFirstComparer(Comparator base)
Method Summary
intcompare(Object a, Object b)
Compare two string objects: case is irrelevant, unless the strings are equal ignoring case, in which case uppercase comes first.

Constructor Detail

UppercaseFirstComparer

public UppercaseFirstComparer(Comparator base)

Method Detail

compare

public int compare(Object a, Object b)
Compare two string objects: case is irrelevant, unless the strings are equal ignoring case, in which case uppercase comes first.

Returns: <0 if a0 if a>b

Throws: ClassCastException if the objects do not implement the CharSequence interface