IntervalTree Class
interval tree
Item Index
Methods
Properties
Methods
add
-
start
-
end
-
[id]
add one interval
Parameters:
-
start
Numberstart of the interval to create
-
end
Numberend of the interval to create
-
[id]
String | Number optionalidentifier to distinguish intervals. Automatically defiend when not set.
Returns:
createNode
-
center
create node by center
Parameters:
-
center
Number
Returns:
node
insert
-
interval
-
node
insert interval to the given node
Returns:
inserted interval
pointSearch
-
val
-
[node]
search intervals at the given node
Parameters:
-
val
Number -
[node]
Node optionalcurrent node to search. default is this.root
Returns:
rangeSearch
-
start
-
end
returns intervals which covers the given start-end interval
Parameters:
-
start
Numberstart of the interval
-
end
Numberend of the interval
Returns:
remove
-
id
removes an interval of the given id
Parameters:
-
id
Number | Stringid of the interval to remove
search
-
val1
-
val2
search intervals when only one argument is given, return intervals which contains the value when two arguments are given, ...
Parameters:
-
val1
Number -
val2
Number
Returns:
intervals
Properties
idCandidate
Number
unique id candidate of interval without id to be added next time
intervalsById
Object(Interval)
interval id => interval
nodesByCenter
Object(Node)
center => node
nodesById
Object(Node)
interval id => node
pointTree
SortedList(Point)
sorted list of whole point