Packagesystem.comparators
Classpublic class PriorityComparator
InheritancePriorityComparator Inheritance Object
Implements Comparator

This comparator compare two Priority objects and use the priority property of this Priority objects.



Public Methods
 MethodDefined By
  
Creates a new PriorityComparator instance.
PriorityComparator
  
compare(o1:*, o2:*, options:* = null):int
Returns an integer value to compare two Number objects.
PriorityComparator
Constructor Detail
PriorityComparator()Constructor
public function PriorityComparator()

Creates a new PriorityComparator instance.

Method Detail
compare()method
public function compare(o1:*, o2:*, options:* = null):int

Returns an integer value to compare two Number objects.

Parameters

o1:* — the first Number object to compare.
 
o2:* — the second Number object to compare.
 
options:* (default = null)

Returns
int

  • 1 if the priority property of o1 is "lower" than (less than, before, etc.) the priority property of o2 ;
  • -1 if the priority property of o1 is "higher" than (greater than, after, etc.) the priority property of o2 ;
  • 0 if the priority property of o1 and the priority property of o2 are equal.

  • Throws
    ArgumentError — if compare(a, b) and 'a' and 'b' must be Priority objects.