IntervalTree<T> class
An immutable, balanced interval tree over a fixed set of IntervalEntrys.
Constructors
-
IntervalTree(Iterable<
IntervalEntry< entries)T> > -
Builds a balanced tree from
entries(any order). Construction isO(n log n)to sort; queries are thenO(log n + k). Audited: 2026-06-12 11:26 EDT
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether the tree holds no intervals.
Audited: 2026-06-12 11:26 EDT
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
Number of intervals in the tree.
Audited: 2026-06-12 11:26 EDT
no setter
Methods
-
hasOverlap(
num low, num high) → bool -
Whether any interval overlaps
[low, high]. Short-circuits on the first match, so it is cheaper than checkingqueryRange(...).isNotEmpty. Audited: 2026-06-12 11:26 EDT -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queryPoint(
num point) → List< IntervalEntry< T> > -
All intervals that contain
point, in ascendingloworder. -
queryRange(
num low, num high) → List< IntervalEntry< T> > -
All intervals overlapping the inclusive range
[low, high], in ascendingloworder. Requireslow <= high. Audited: 2026-06-12 11:26 EDT -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited