Module omix.api

Class StringComparator

java.lang.Object
omix.util.collections.StringComparator
All Implemented Interfaces:
Serializable, Comparator<String>

public class StringComparator
extends Object
implements Comparator<String>, Serializable
Compares two strings.
Author:
Dr. Peter Droste, Omix Visualization
See Also:
Serialized Form
  • Field Details

  • Method Details

    • compare

      public int compare​(String strg1, String strg2)
      Compares two strings.
      Specified by:
      compare in interface Comparator<String>
      Parameters:
      strg1 - first string
      strg2 - second string
      Returns:
      0 if strings are equals, 1 if str1 is greater than strg2 and -1 otherwise. A String is greater than another if its length is greater. If the length is equals, the one is greater containing the first higher character value.
      See Also:
      Comparator.compare(java.lang.Object, java.lang.Object)