StrictComparable<T extends Object> class
abstract
An easy way to implement Comparable in a way that compareTo aggrees with > and == operators
This is a child class of EasyComparable that only takes the covariant
type T
on the > and < operators
If you need to specify what Type is used on > and < operators, use SpecificComparable
- Inheritance
-
- Object
- EasyComparable<
T> - SpecificComparable<
T, T> - StrictComparable
- Available extensions
Constructors
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
-
compareTo(
T other) → int -
Compares this object to another object.
inherited
-
limitTo(
T min, T max) → T -
Available on T, provided by the ComparableExtensions extension
returns this if it is betweenmin
andmax
(inclusive) otherwise returnsmin
ormax
whichever is closer -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withLowerLimit(
T min) → T -
Available on T, provided by the ComparableExtensions extension
returns this if it is not greater than max, otherwise max -
withUpperLimit(
T max) → T -
Available on T, provided by the ComparableExtensions extension
returns this if it is not greater thanmax
, otherwisemax
Operators
-
operator <(
covariant T other) → bool -
< operator to compare this and
other
. Overriding it is optional, it has a default implementation that uses == and > operatorsinherited -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >(
covariant T other) → bool -
> operator to compare this and
other
. If this is overridden, the < operator uses it to compute its value, but can also be overriddeninherited