Class UppercaseFirstComparer

java.lang.Object
net.sf.saxon.sort.UppercaseFirstComparer
All Implemented Interfaces:
Serializable, Comparator

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
See Also:
  • Constructor Details

    • UppercaseFirstComparer

      public UppercaseFirstComparer(Comparator base)
  • Method Details

    • 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.
      Specified by:
      compare in interface Comparator
      Returns:
      invalid input: '<'0 if ainvalid input: '<'b, 0 if a=b, >0 if a>b
      Throws:
      ClassCastException - if the objects do not implement the CharSequence interface