Max<T extends Comparable<Object?> > class
final
A Max represents a convex (contiguous) portion of a domain bounded on the upper end, i.e. { x | x < value }
.
T
is expected to be immutable. If T
is mutable, the value produced by Comparable.compare must not change when
used in a Max. Doing so will result in undefined behaviour.
- Inheritance
-
- Object
- Range<
T> - IterableRange<
T> - Max
Constructors
- Max.closed(T value)
-
Creates a Max with the closed upper bound.
const
- Max.open(T value)
-
Creates a Max with the open upper bound.
const
Properties
- closed → bool
-
Whether the upper bound is closed.
no setter
- empty → bool
-
Return
true
if this is empty, i.e.[a..a)
.no setteroverride - hashCode → int
-
The hash code for this object.
no setteroverride
- open → bool
-
Whether the upper bound is open.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → T
-
The maximum value.
final
Methods
-
besides(
Range< T> other) → bool -
Returns
true
if an empty range exists between this andother
.override -
contains(
T value) → bool -
Returns
true
if this containsvalue
.override -
containsAll(
Iterable< T> values) → bool -
Returns
true
if this contains allvalues
.inherited -
encloses(
Range< T> other) → bool -
Returns
true
ifother
's bounds do not extend outside this bounds.override -
gap(
Range< T> other) → Interval<T> ? -
If this does not intersect
other
, returns the gap in between. Otherwise returnsnull
.override -
intersection(
Range< T> other) → Range<T> ? -
If this intersects
other
, returns the intersection. Otherwise returnsnull
.override -
intersects(
Range< T> other) → bool -
Returns
true
if a non-empty range exists between this andother
.override -
iterate(
{required T by(T current)}) → Iterable< T> -
Returns a lazy
Iterable
by stepping through this range usingby
.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override