- java.lang.Object
-
- org.snmp4j.agent.MOScopeComparator
-
- org.snmp4j.agent.util.MOScopePriorityComparator
-
- All Implemented Interfaces:
Comparator<MOScope>
public class MOScopePriorityComparator extends MOScopeComparator
TheMOScopePriorityComparator
applies a sorting on a list ofMOScope
instances defined by a priority list. For instances where no priority is set by the priority list, this iterator will return them after the other items in default order defined byMOScopeComparator
.- Since:
- 3.5.0
- Version:
- 3.5.0
- Author:
- Frank Fock
-
-
Constructor Summary
Constructors Constructor Description MOScopePriorityComparator(SortedMap<org.snmp4j.smi.OID,Integer> priorityMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(MOScope o1, MOScope o2)
Compares a scope with another scope or query.-
Methods inherited from interface java.util.Comparator
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from class org.snmp4j.agent.MOScopeComparator
equals, hashCode, isQueryContextMatching
-
-
-
-
Method Detail
-
compare
public int compare(MOScope o1, MOScope o2)
Description copied from class:MOScopeComparator
Compares a scope with another scope or query. See also the class description how comparison is done.- Specified by:
compare
in interfaceComparator<MOScope>
- Overrides:
compare
in classMOScopeComparator
- Parameters:
o1
- a MOScope instance.o2
- a MOScope instance.- Returns:
- an integer less than zero if
o1
is less thano2
and zero if both values are deemed to be equal and a value greater than zero ifo1
is greater thano2
.
-
-