Class: SC.Comparable

Implements some standard methods for comparing objects. Add this mixin to any class you create that can compare its instances.

You should implement the compare() method.

Defined in: comparable.js

SproutCore 1.0

Field Summary

Class Methods

Field Detail

SC.Comparable.isComparable Boolean
walk like a duck. Indicates that the object can be compared.

Class Method Detail

compare(a, b)

Override to return the result of the comparison of the two parameters. The compare method should return

  -1 if a < b
   0 if a == b
   1 if a > b

Default implementation raises an exception.

{Object} the first object to compare
{Object} the second object to compare
the result of the comparison
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:20 GMT-0600 (CST)