Class AlphanumComparator

java.lang.Object
de.gurkenlabs.litiengine.util.AlphanumComparator
All Implemented Interfaces:
java.util.Comparator<java.lang.String>

public class AlphanumComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.String>
This is an updated version with enhancements made by Daniel Migowski, Andre Bogus, and David Koelle. Updated by David Koelle in 2017. To use this class: Use the static "sort" method from the java.util.Collections class: Collections.sort(your list, new AlphanumComparator());
  • Constructor Summary

    Constructors 
    ConstructorDescription
    AlphanumComparator() 
  • Method Summary

    Modifier and TypeMethodDescription
    intcompare​(java.lang.String s1, java.lang.String s2) 
    static intcompareTo​(java.lang.String s1, java.lang.String s2) 

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Comparator

    equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
  • Constructor Details

  • Method Details

    • compare

      public int compare​(java.lang.String s1, java.lang.String s2)
      Specified by:
      compare in interface java.util.Comparator<java.lang.String>
    • compareTo

      public static int compareTo​(java.lang.String s1, java.lang.String s2)