1 USING: help.markup help.syntax ;
\r
5 { $values { "key" "an object" } { "map" "an interval map" } { "value" "the value for the key, or f" } { "?" "whether the key is present" } }
\r
6 { $description "Looks up a key in an interval map, returning the corresponding value if the item is in an interval in the map, and a boolean flag. The operation takes O(log n) time." } ;
\r
9 { $values { "key" "an object" } { "map" "an interval map" } { "value" "the value for the key, or f" } }
\r
10 { $description "Looks up a key in an interval map, returning the value of the corresponding interval, or f if the interval is not present in the map." } ;
\r
13 { $values { "key" "an object" } { "map" "an interval map" } { "?" "a boolean" } }
\r
14 { $description "Tests whether an object is in an interval in the interval map, returning t if the object is present." } ;
\r
16 HELP: <interval-map>
\r
17 { $values { "specification" "an assoc" } { "map" "an interval map" } }
\r
18 { $description "From a specification, produce an interval tree. The specification is an assoc where the keys are intervals, or pairs of numbers to represent intervals, or individual numbers to represent singleton intervals. The values are the values int he interval map. Construction time is O(n log n)." } ;
\r
20 ARTICLE: "interval-maps" "Interval maps"
\r
21 "The " { $vocab-link "interval-maps" } " vocabulary implements a data structure, similar to assocs, where a set of closed intervals of keys are associated with values. As such, interval maps do not conform to the assoc protocol, because intervals of floats, for example, can be used, and it is impossible to get a list of keys in between."
\r
23 "The following operations are used to query interval maps:"
\r
24 { $subsection interval-at* }
\r
25 { $subsection interval-at }
\r
26 { $subsection interval-key? }
\r
27 "Use the following to construct interval maps"
\r
28 { $subsection <interval-map> } ;
\r
30 ABOUT: "interval-maps"
\r