|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmckay.utilities.general.SmartComparator
public class SmartComparator
A Comparator that can be used for making comparisons in tasks such as sorting. Performs numerical comparisons for integers, shorts, longs, doubles and floats and performs string comparisons for all other types of objects, where case is ignored and a Collator for the default location is used.
Constructor Summary | |
---|---|
SmartComparator()
Basic constructor that stores the settings for the default locale. |
Method Summary | |
---|---|
int |
compare(boolean a,
boolean b)
Compares the two arguments for order. |
int |
compare(double a,
float b)
Compares the two arguments for order. |
int |
compare(float a,
float b)
Compares the two arguments for order. |
int |
compare(int a,
int b)
Compares the two arguments for order. |
int |
compare(long a,
long b)
Compares the two arguments for order. |
int |
compare(java.lang.Object a,
java.lang.Object b)
Compares the two arguments for order. |
int |
compare(short a,
short b)
Compares the two arguments for order. |
int |
compare(java.lang.String a,
java.lang.String b)
Compares the two arguments for order. |
boolean |
equals(java.lang.Object object)
Indicates whether the given object is "equal to" this Comparator. |
java.text.Collator |
getCollator()
Get the Collator used by this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SmartComparator()
Method Detail |
---|
public int compare(java.lang.Object a, java.lang.Object b)
compare
in interface java.util.Comparator
a
- The first item to compare.b
- The second item to compare.
public int compare(java.lang.String a, java.lang.String b)
a
- The first item to compare.b
- The second item to compare.
public int compare(int a, int b)
a
- The first item to compare.b
- The second item to compare.
public int compare(long a, long b)
a
- The first item to compare.b
- The second item to compare.
public int compare(short a, short b)
a
- The first item to compare.b
- The second item to compare.
public int compare(double a, float b)
a
- The first item to compare.b
- The second item to compare.
public int compare(float a, float b)
a
- The first item to compare.b
- The second item to compare.
public int compare(boolean a, boolean b)
a
- The first item to compare.b
- The second item to compare.
public boolean equals(java.lang.Object object)
equals
in interface java.util.Comparator
equals
in class java.lang.Object
object
- The object to check for equality.
public java.text.Collator getCollator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |