IntervalTree<T> class

An immutable, balanced interval tree over a fixed set of IntervalEntrys.

Constructors

IntervalTree(Iterable<IntervalEntry<T>> entries)
Builds a balanced tree from entries (any order). Construction is O(n log n) to sort; queries are then O(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 checking queryRange(...).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 ascending low order.
queryRange(num low, num high) List<IntervalEntry<T>>
All intervals overlapping the inclusive range [low, high], in ascending low order. Requires low <= 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