public class ComparatorUtils
extends java.lang.Object
限定符和类型 | 方法和说明 |
---|---|
static boolean |
arg1InArg2(java.lang.Object o1,
java.lang.Object o2) |
static int |
compare(java.util.Comparator comparator,
java.lang.Object obj1,
java.lang.Object obj2) |
static int |
compare(double d1,
double d2) |
static int |
compare(java.lang.Object obj1,
java.lang.Object obj2)
Compares its two arguments for order.
|
static int |
compare(java.lang.Object obj1,
java.lang.Object obj2,
java.util.Comparator comparator) |
static int |
compareCommonType(java.lang.Object obj1,
java.lang.Object obj2)
一个通用的比较器,比较规则为(null->空->先数字->再大写英文->小写英文->中文->)日期类型按照日期大小
字符串比较时,从第一个字符开始比较直到比较出一个非0的结果,如果比完了还没有就判定相等
|
static int |
compareSQLType(java.lang.Object obj1,
java.lang.Object obj2)
比较从数据库中取出的对象,但只比较了数值,字符串,Date, boolean类型,其他类型抛异常
没有严格遵守传递性,特殊情况下会有问题。"
|
static boolean |
equals_exactly(java.lang.Object obj1,
java.lang.Object obj2) |
static boolean |
equals(boolean[] array1,
boolean[] array2) |
static boolean |
equals(byte[] array1,
byte[] array2) |
static boolean |
equals(char[] array1,
char[] array2) |
static boolean |
equals(double[] array1,
double[] array2) |
static boolean |
equals(int[] array1,
int[] array2) |
static boolean |
equals(java.util.Iterator it1,
java.util.Iterator it2) |
static boolean |
equals(long[] array1,
long[] array2) |
static boolean |
equals(java.lang.Object[] array1,
java.lang.Object[] array2) |
static boolean |
equals(java.lang.Object obj1,
java.lang.Object obj2)
peter:比较相等.
|
static boolean |
equals(java.lang.String obj1,
java.lang.String obj2)
peter:比较相等.
|
static boolean |
equalsIgnoreCase(java.lang.String obj1,
java.lang.String obj2)
比较两个字符串在无视大小写的情况下是否相等.
|
static boolean |
tableDataColumnNameEquals(java.lang.String name1,
java.lang.String name2) |
public static int compare(java.lang.Object obj1, java.lang.Object obj2)
obj1
- the first object to be compared.(The value of obj1 may be null).obj2
- the second object to be compared.(The value of obj2 may be null).public static int compare(java.lang.Object obj1, java.lang.Object obj2, java.util.Comparator comparator)
public static int compareSQLType(java.lang.Object obj1, java.lang.Object obj2) throws java.lang.IllegalArgumentException
obj1
- 第一个被比较的对象obj2
- 第二个被比较的对象java.lang.IllegalArgumentException
public static int compare(double d1, double d2)
public static int compare(java.util.Comparator comparator, java.lang.Object obj1, java.lang.Object obj2)
public static boolean arg1InArg2(java.lang.Object o1, java.lang.Object o2)
public static boolean equalsIgnoreCase(java.lang.String obj1, java.lang.String obj2)
obj1
- 字符串对象1obj2
- 字符串对象2public static boolean equals(java.lang.String obj1, java.lang.String obj2)
obj1
- may be null.obj2
- may be null.public static boolean equals(java.lang.Object obj1, java.lang.Object obj2)
obj1
- may be null.obj2
- may be null.public static boolean equals_exactly(java.lang.Object obj1, java.lang.Object obj2)
public static boolean tableDataColumnNameEquals(java.lang.String name1, java.lang.String name2)
public static boolean equals(java.util.Iterator it1, java.util.Iterator it2)
public static boolean equals(java.lang.Object[] array1, java.lang.Object[] array2)
public static boolean equals(int[] array1, int[] array2)
public static boolean equals(long[] array1, long[] array2)
public static boolean equals(double[] array1, double[] array2)
public static boolean equals(byte[] array1, byte[] array2)
public static boolean equals(char[] array1, char[] array2)
public static boolean equals(boolean[] array1, boolean[] array2)
public static int compareCommonType(java.lang.Object obj1, java.lang.Object obj2)
obj1
- 对象1obj2
- 对象2