Package | org.as3coreaddendum.system.comparators |
Class | public class PriorityIndexComparator |
Inheritance | PriorityIndexComparator ![]() |
Implements | IComparator |
org.as3coreaddendum.system.IPriority
and org.as3coreaddendum.system.IIndexable
interfaces, comparing the priority
and index
properties.
This comparator is util when you want to sort the objects by priority, but if the priority of the two objects are equal, the index
property of the objects are compared to decide wich object comes before.
See also
Method | Defined By | ||
---|---|---|---|
Constructor, creates a new PriorityIndexComparator object. | PriorityIndexComparator | ||
compare(o1:*, o2:*):int
Performs the comparison between the two arguments. | PriorityIndexComparator |
PriorityIndexComparator | () | Constructor |
public function PriorityIndexComparator()
Constructor, creates a new PriorityIndexComparator
object.
compare | () | method |
public function compare(o1:*, o2:*):int
Performs the comparison between the two arguments.
Parameters
o1:* — The first Number object to be compared.
| |
o2:* — The second Number object to be compared.
|
int — A negative integer or a positive integer as the priority of the first argument is greater than or less than the second. If the priority of the arguments are equal, returns a negative integer, zero, or a positive integer as the index of the first argument is less than, equal to, or greater than the second.
|
ArgumentError — if any of the arguments does not implements the IPriority or IIndexable interfaces.
|