Class MOScopePriorityComparator

java.lang.Object
org.snmp4j.agent.MOScopeComparator
org.snmp4j.agent.util.MOScopePriorityComparator
All Implemented Interfaces:
Comparator<MOScope>

public class MOScopePriorityComparator extends MOScopeComparator
The MOScopePriorityComparator applies a sorting on a list of MOScope 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 by MOScopeComparator.
Since:
3.5.0
Version:
3.5.0
Author:
Frank Fock
  • Constructor Details

    • MOScopePriorityComparator

      public MOScopePriorityComparator(SortedMap<org.snmp4j.smi.OID,Integer> priorityMap)
  • Method Details

    • 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 interface Comparator<MOScope>
      Overrides:
      compare in class MOScopeComparator
      Parameters:
      o1 - a MOScope instance.
      o2 - a MOScope instance.
      Returns:
      an integer less than zero if 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.