Specifies that the order of an element in a collection can be determined by calling object.compare(otherObject)
Example:
class Element implements polygonal.ds.Comparable<Element> {
public var val:Int;
public function new() {}
public function compare(other:Element):Int {
return val - other.val;
}
}
Methods
compare (other:T):Int
Compares this object to other
.
The return value should be > 0 if this object is "bigger" than other
, < 0 if this object is "smaller" than other
and 0 if both are "equal".