DoubleRange class
Represents a range of double values.
This class allows defining a range with a start and end value, and whether the start and end are inclusive or exclusive.
Constructors
- DoubleRange.new(num? start, num? end, {bool startInclusive = true, bool endInclusive = false})
- Creates a new DoubleRange instance.
Properties
- endInclusive → bool
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startInclusive → bool
-
no setterinherited
Methods
-
compareTo(
Range< Comparable> other) → int -
Compares this range to another range. First compare starts of the ranges. If start
of this range is less than the start of the other, return -1, if it's greater, return 1.
If both starts are equal, compare ends of the ranges.
inherited
-
contains(
Object? obj) → bool -
Detect whether this range contains an element.
inherited
-
end(
{bool? inclusive}) → num? -
Returns the end value of the range, optionally with inclusion overridden.
inherited
-
except(
Range< num> that) → List<Range< num> > -
The difference between two ranges is the set of all elements that are in this range but not in the other range.
inherited
-
intersect(
Range< num> that) → Range<num> ? -
The intersection of two ranges is the set of all elements that are in both ranges.
inherited
-
isAdjacentTo(
Range< num> that) → bool -
Test whether this range is adjacent to another range. The ranges are adjacent
if the end of this range is the same as the start of the other range or vice versa.
inherited
-
isSubsetOf(
Range< num> that, {bool strict = false}) → bool -
Evaluate whether this range is a subset of another.
inherited
-
isSupersetOf(
Range< num> that, {bool strict = false}) → bool -
Evaluate whether this range is a superset of another.
inherited
-
newInstance(
) → DoubleRange -
Creates a new empty instance of the range.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overlaps(
Range< num> that) → bool -
Check whether this range overlaps with another range.
inherited
-
start(
{bool? inclusive}) → num? -
Returns the start value of the range, optionally with inclusion overridden.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
union(
Range< num> that) → List<Range< num> > -
The union of two ranges is the set of all elements that are in either range.
inherited
Operators
-
operator *(
Range< num> that) → Range<num> ? -
Operator for the intersection of this range and another range.
inherited
-
operator +(
Range< num> that) → List<Range< num> > -
Operator for the union of this range and another range.
inherited
-
operator -(
Range< num> that) → List<Range< num> > -
Operator for the difference between this range and another range.
inherited
-
operator ==(
Object that) → bool -
Ranges are equal if they have same start and end dates and inclusions.
inherited
Static Properties
- regexInfInf ↔ RegExp
-
Regular expression for a range from negative to positive infinity.
getter/setter pair
- regexInfVal ↔ RegExp
-
Regular expression for a range from negative infinity to a double.
getter/setter pair
- regexValInf ↔ RegExp
-
Regular expression for a range from a double to positive infinity.
getter/setter pair
- regexValVal ↔ RegExp
-
Regular expression for a range between two doubles.
getter/setter pair
Static Methods
-
listExcept(
List< DoubleRange> source, List<DoubleRange> exceptions) → List<DoubleRange> - Creates a new list of DoubleRange instances by excluding ranges from a source list.
-
parse(
String? input, {bool? startInclusive, bool? endInclusive}) → DoubleRange? - Parses a string representation of a double range.