Move intervaltre under uxbox.util submodule.

This commit is contained in:
Andrey Antukh 2016-06-22 21:18:02 +03:00
parent 77933f3949
commit bced1ebd2f
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -6,15 +6,18 @@
*/ */
"use strict"; "use strict";
goog.provide("intervaltree.core");
goog.provide("uxbox.util.intervaltree_impl");
goog.require("goog.asserts"); goog.require("goog.asserts");
goog.require("goog.array"); goog.require("goog.array");
goog.scope(function() { goog.scope(function() {
const self = uxbox.util.intervaltree_impl;
const assert = goog.asserts.assert; const assert = goog.asserts.assert;
const every = goog.array.every; const every = goog.array.every;
const ID_SYM = Symbol.for("intervaltree.core:id-sym"); const ID_SYM = Symbol.for("uxbox.util.intervaltree:id-sym");
// --- Types Declaration // --- Types Declaration
@ -383,20 +386,20 @@ goog.scope(function() {
} }
// Api // Api
intervaltree.core.create = create; self.create = create;
intervaltree.core.add = add; self.add = add;
intervaltree.core.remove = remove; self.remove = remove;
intervaltree.core.removeById = removeById; self.removeById = removeById;
intervaltree.core.contains = contains; self.contains = contains;
intervaltree.core.search = search; self.search = search;
intervaltree.core.searchSingle = searchSingle; self.searchSingle = searchSingle;
// Test // Test
module.test = function() { self.test = function() {
// const util = require('util'); // const util = require('util');
console.time("init"); console.time("init");
const tree = module.create([ const tree = self.create([
[1,5], [-5, 10], [4, 9], [1,5], [-5, 10], [4, 9],
[10,14], [-10, 1], [9, 22], [10,14], [-10, 1], [9, 22],
]); ]);