public class MOScopeComparator extends Object implements Comparator<MOScope>
MOScopeComparator compares two scopes with each other.
Two scopes are compared by their context (if both are MOContextScope
instances) first and then by their lower bound.
A scope is compared with a query by comparing the scope with the queries
scope and then if both are deemed to be equal, the upper bound of the scope
is checked. If it is unbounded (upper bound is null
| Constructor and Description |
|---|
MOScopeComparator() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(MOScope o1,
MOScope o2)
Compares a scope with another scope or query.
|
boolean |
equals(Object obj) |
int |
hashCode() |
static boolean |
isQueryContextMatching(MOQuery a,
MOScope b)
Indicates whether the given query's context matches the context of the given
scope.
|
public int compare(MOScope o1, MOScope o2)
compare in interface Comparator<MOScope>o1 - a MOscope instance.o2 - a MOscope instance.o1 is less than o2
and zero if both values are deemed to be equal and a value greater than
zero if o1 is greater than o2.public static boolean isQueryContextMatching(MOQuery a, MOScope b)
a - a MOQuery instance.b - another MOScope instance.true if the query's context is null or if both contexts
match or if the context of scope is the empty string.public boolean equals(Object obj)
equals in interface Comparator<MOScope>equals in class ObjectCopyright © 2015 SNMP4J.org. All rights reserved.