CompareOperators<T> mixin

A generic mixin that provides standard comparison operators like <, <=, >=, and > provided the class implements Comparable.

Implemented types
Available extensions

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

between(T min, T max) → bool

Available on Comparable<T>, provided by the ComparableExtension extension

Whether this object is between min and max (inclusive).
clip(T min, T max) → T

Available on Comparable<T>, provided by the ComparableExtension extension

Clips this object to the range from min to max.
compareTo(T other) → int
Compares this object to another object.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator <(T other) → bool
Whether this object is less than other.
operator <=(T other) → bool
Whether this object is less than or equal to other.
operator ==(Object other) → bool
The equality operator.
inherited
operator >(T other) → bool
Whether this object is greater than other.
operator >=(T other) → bool
Whether this object is greater than or equal to other.