Class NaturalStringComparator

java.lang.Object
com.atlassian.confluence.pages.NaturalStringComparator
All Implemented Interfaces:
Comparator<String>

public class NaturalStringComparator extends Object implements Comparator<String>
A comparator makes string comparisons based on their natural order. The logic used to perform the natrual comparison is taken from the original page tree macro, the complete source can be found here: https://svn.atlassian.com/svn/public/contrib/confluence/pagetree-plugin/tags/pagetree-plugin-1.6/src/main/java/com/eekboom/utils/Strings.java

A google search revealed that this class was probably taken from this blog post: http://weblogs.java.net/blog/skelvin/archive/2006/01/natural_string.html

I refactored the original static util class into a comparator because static util classes are bad.

  • Constructor Details

    • NaturalStringComparator

      public NaturalStringComparator()
      Constructs a comparator for the default system locale.
      See Also:
    • NaturalStringComparator

      public NaturalStringComparator(Locale locale)
      Constructs a comparator using the specified locale.
      See Also:
  • Method Details