Package | org.as3coreaddendum.system.comparators |
Class | public class BooleanComparator |
Inheritance | BooleanComparator ![]() |
Implements | IComparator |
Boolean
objects.
Property | Defined By | ||
---|---|---|---|
comparison : BooleanComparison
Defines the type of comparison to be used. | BooleanComparator |
Method | Defined By | ||
---|---|---|---|
BooleanComparator(comparison:BooleanComparison)
Constructor, creates a new BooleanComparator object. | BooleanComparator | ||
compare(o1:*, o2:*):int
Performs the comparison between the two arguments. | BooleanComparator | ||
toString():String
Returns the string representation of this object. | BooleanComparator |
comparison | property |
comparison:BooleanComparison
Defines the type of comparison to be used.
public function get comparison():BooleanComparison
public function set comparison(value:BooleanComparison):void
ArgumentError — If is assigned a null value.
|
See also
BooleanComparator | () | Constructor |
public function BooleanComparator(comparison:BooleanComparison)
Constructor, creates a new BooleanComparator
object.
comparison:BooleanComparison — Indicates which type of comparison will be used.
|
ArgumentError — If the 'comparison' argument is null .
|
See also
compare | () | method |
public function compare(o1:*, o2:*):int
Performs the comparison between the two arguments.
Parameters
o1:* — The first Boolean object to be compared.
| |
o2:* — The second Boolean object to be compared.
|
int — A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
|
ArgumentError — if any of the arguments are not of type Boolean .
|
toString | () | method |
public function toString():String
Returns the string representation of this object.
ReturnsString — the string representation of the this object.
|
import org.as3coreaddendum.system.comparators.BooleanComparator; var b1:BooleanComparator = new BooleanComparator(BooleanComparison.TRUE_FIRST); b1.compare(true, false); // -1 b1.compare(false, true); // 1 var b2:BooleanComparator = new BooleanComparator(BooleanComparison.FALSE_FIRST); b2.compare(true, false); // 1 b2.compare(false, true); // -1