| java.lang.Object org.obe.engine.util.Comparators
Comparators | final public class Comparators (Code) | | Implements comparisons between objects.
author: Adrian Price. |
Method Summary | |
public static int | compare(Object o1, Object o2) Compares two objects, accounting for null values. | public static boolean | equals(Object o1, Object o2) Checks whether two objects are equal. | public static boolean | match(Object[] subset, Object[] superset, boolean identical) Determines whether one set of values is an ordered subset of another.
Parameters: subset - Values required for a match. Parameters: superset - Possible values to match against. Parameters: identical - true to match exactly in number and value.false to match within a particular scope. |
compare | public static int compare(Object o1, Object o2)(Code) | | Compares two objects, accounting for null values. Nulls are treated as
the lexically smallest values, which results in their being sorted to the
start of the list.
Parameters: o1 - First object to compare. Parameters: o2 - Second object to compare. 0 if the objects are equal or both null , otherwisethe result of executing ((Comparable)o1).compareTo(o2) . throws: ClassCastException - if o1 does not implementjava.lang.Comparable , or if the two objects are of mutuallyincompatible (non-comparable) classes. |
equals | public static boolean equals(Object o1, Object o2)(Code) | | Checks whether two objects are equal.
Parameters: o1 - Parameters: o2 - true if o1 and o2 are both null or are equal. |
match | public static boolean match(Object[] subset, Object[] superset, boolean identical)(Code) | | Determines whether one set of values is an ordered subset of another.
Parameters: subset - Values required for a match. Parameters: superset - Possible values to match against. Parameters: identical - true to match exactly in number and value.false to match within a particular scope. For example,subset {x,y} would match supersets{x,y}, {x,y,z1} ... {x,y,zN} etc. true if subset is an ordered subset ofsuperset (or identical is true andthe two sets are identical). |
|
|