Class Compare_en


  • public class Compare_en
    extends TextComparer
    A Comparer used with lang="en". Note this only does anything intelligent with characters in ISO 8859/1, which are mapped to their unaccented equivalents
    Author:
    Michael H. Kay
    • Constructor Summary

      Constructors 
      Constructor Description
      Compare_en()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.lang.Object a, java.lang.Object b)
      Compare two string objects, in three phases: (a) ignoring accents and case (b) if still equal, ignoring case (c) if still equal, taking case into account
      Comparer setCaseOrder​(int caseOrder)
      Set case order
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • caseOrder

        int caseOrder
    • Constructor Detail

      • Compare_en

        public Compare_en()
    • Method Detail

      • compare

        public int compare​(java.lang.Object a,
                           java.lang.Object b)
        Compare two string objects, in three phases: (a) ignoring accents and case (b) if still equal, ignoring case (c) if still equal, taking case into account
        Specified by:
        compare in class Comparer
        Returns:
        <0 if a0 if a>b
      • setCaseOrder

        public Comparer setCaseOrder​(int caseOrder)
        Description copied from class: TextComparer
        Set case order
        Overrides:
        setCaseOrder in class TextComparer
        Parameters:
        caseOrder - one of DEFAULT_CASE_ORDER, LOWERCASE_FIRST, or UPPERCASE_FIRST. Indicates whether upper case letters precede or follow lower case letters in the ordering
        Returns:
        either this or a different Comparer that will be used to perform the comparisons. This allows the TextComparer to delegate the comparison to a Comparer dedicated to a specific case order.