public class UnitsNumberStringComparator extends Object implements Comparator<CharSequence>
The syntax for numbers is the same as for DecimalNumberStringComparator
; the SI suffix must
immediately follow the number.
Constructor and Description |
---|
UnitsNumberStringComparator(DecimalNumberStringComparator numberComparator)
Constructor with decimal number comparator.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(CharSequence s1,
CharSequence s2) |
static UnitsNumberStringComparator |
getInstance()
Returns the instance for the default locale.
|
static UnitsNumberStringComparator |
getInstance(Locale locale)
Returns an instance for the specified locale.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public UnitsNumberStringComparator(DecimalNumberStringComparator numberComparator)
numberComparator
- the decimal number comparatorpublic static UnitsNumberStringComparator getInstance()
Locale.getDefault()
public static UnitsNumberStringComparator getInstance(Locale locale)
public int compare(CharSequence s1, CharSequence s2)
compare
in interface Comparator<CharSequence>
Copyright © 2024. All rights reserved.