|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectncsa.tools.common.util.ComparisonUtils
Wrapper static methods for doing arbitrary object comparisons. Also includes static method for matching filter against a map.
| Method Summary | |
static boolean |
compare(java.lang.Object arg1,
java.lang.Object arg2,
int comparator,
java.lang.Class cast)
First attempts any primitive cast indicated. |
static boolean |
compare(java.lang.Object arg1,
java.lang.Object arg2,
int type,
int comparator)
Compares a File to either another File, a Long or a String; checks the type parameter for the semantics of the comparison. |
static java.lang.String |
getComparator(int comparatorValue)
|
static int |
getComparatorValue(java.lang.String s)
|
static boolean |
matches(ClassFilter filter,
java.lang.Class clzz)
Checks to see if the class of the type is assignable from the given class. |
static boolean |
matches(MatchFilter filter,
java.util.Map properties)
Checks the match filter against the map of properties. |
static boolean |
matches(MatchFilter filter,
java.util.Map properties,
boolean convertTypes)
Checks the match filter against the map of properties. |
static boolean |
matches(TypeFilter filter,
java.lang.String type)
Checks to see if the type strings are equal (case-insensitive). |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static boolean compare(java.lang.Object arg1,
java.lang.Object arg2,
int type,
int comparator)
throws FailedComparisonException
FailedComparisonException#applyFileComparator
public static boolean compare(java.lang.Object arg1,
java.lang.Object arg2,
int comparator,
java.lang.Class cast)
throws FailedComparisonException
arg1 - to comparearg2 - to compare to.comparator - to use.cast - class to cast to (for primitive conversion; can be
null).
NCSAException - if types do not match.
FailedComparisonException
public static int getComparatorValue(java.lang.String s)
throws java.lang.IllegalArgumentException
s - string representation.
java.lang.IllegalArgumentExceptionpublic static java.lang.String getComparator(int comparatorValue)
comparatorValue - int value.
public static boolean matches(ClassFilter filter,
java.lang.Class clzz)
filter - to match.clzz - to check against filter.
null, returns true; if clzz
satisfies filter, returns true; else returns false.
public static boolean matches(TypeFilter filter,
java.lang.String type)
filter - to match.type - to check against filter.
null, returns true; if type
satisfies filter, returns true; else returns false.
public static boolean matches(MatchFilter filter,
java.util.Map properties)
throws FailedComparisonException
filter - to match.properties - map of properties against which to match.
null, returns true; if the filter
is empty (no clauses), returns the negation of the filter's 'not'
field; if property map satisfies filter, returns true; else
returns false.
FailedComparisonException
public static boolean matches(MatchFilter filter,
java.util.Map properties,
boolean convertTypes)
throws FailedComparisonException
filter - to match.properties - map of properties against which to match.convertTypes - whether to try to flexibly convert the types to match String/numeric values
null, returns true; if the filter
is empty (no clauses), returns the negation of the filter's 'not'
field; if property map satisfies filter, returns true; else
returns false.
FailedComparisonException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||