forked from thomasstjerne/js_cols
-
Notifications
You must be signed in to change notification settings - Fork 0
/
js_cols.min.js
144 lines (144 loc) · 58.8 KB
/
js_cols.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
js_cols={global:this};js_cols.getUid=function(a){return a[js_cols.UID_PROPERTY_]||(a[js_cols.UID_PROPERTY_]=++js_cols.uidCounter_)};js_cols.removeUid=function(a){"removeAttribute"in a&&a.removeAttribute(js_cols.UID_PROPERTY_);try{delete a[js_cols.UID_PROPERTY_]}catch(b){}};js_cols.UID_PROPERTY_="js_cols_uid_"+Math.floor(Math.random()*2147483648).toString(36);js_cols.uidCounter_=0;
js_cols.getValues=function(a){if(js_cols.typeOf(a)=="array")return a;else if(a.getValues)b=a.getValues();else{var b=[],c=0,d;for(d in a)b[c++]=a[d]}return b};js_cols.getKeys=function(a){if(a.getKeys)return a.getKeys();else if(js_cols.typeOf(a)=="array"){for(var b=[],c=0;c<a.length;c++)b.push(c);return b}else if(js_cols.typeOf(a)=="object"){var b=[],c=0,d;for(d in a)b[c++]=d;return b}};
js_cols.every=function(a,b,c){if(js_cols.typeOf(a.every)=="function")return a.every(b,c);else if(js_cols.typeOf(a.getValues)=="function"){for(var a=a.getValues(),d=0;d<a.length;d++)if(!b.call(c,a[d],d,a))return!1;return!0}else if(js_cols.typeOf(a)=="array"){for(d=0;d<a.length;d++)if(!b.call(c,a[d],d,a))return!1;return!0}else if(js_cols.typeOf(a)=="object"){for(d in a)if(!b.call(c,a[d],d,a))return!1;return!0}};
js_cols.forEach=function(a,b,c){if(js_cols.typeOf(a.forEach)=="function")a.forEach(b,c);else if(js_cols.typeOf(a.getValues)=="function")for(var a=a.getValues(),d=0;d<a.length;d++)b.call(c,a[d],d,a);else if(js_cols.typeOf(a)=="array")for(d=0;d<a.length;d++)b.call(c,a[d],d,a);else if(js_cols.typeOf(a)=="object")for(d in a)b.call(c,a[d],d,a)};
js_cols.getCount=function(a){if(typeof a.getCount=="function")return a.getCount();else if(a.length&&typeof a.length=="number")return a.length;else{var b=0,c;for(c in a)b++;return b}};js_cols.contains=function(a,b){if(typeof a.contains=="function")return a.contains(b);if(typeof a.containsValue=="function")return a.containsValue(b);if(js_cols.typeOf(a)=="array"){for(var c=0;c<a.length;c++)if(a[c]==b)return!0;return!1}for(c in a)if(a[c]==b)return!0;return!1};
js_cols.typeOf=function(a){var b=typeof a;if(b=="object")if(a){if(a instanceof Array||!(a instanceof Object)&&Object.prototype.toString.call(a)=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(!(a instanceof Object)&&(Object.prototype.toString.call(a)=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call")))return"function"}else return"null";
else if(b=="function"&&typeof a.call=="undefined")return"object";return b};js_cols.inherits=function(a,b){function c(){}c.prototype=b.prototype;a.superClass_=b.prototype;a.prototype=new c;a.prototype.constructor=a};js_cols.LinkedList=function(){this.sentinel={};this.sentinel.next=this.sentinel;this.sentinel.previous=this.sentinel;this.size=0};js_cols.LinkedList.prototype.getCount=function(){return this.size};
js_cols.LinkedList.prototype.addFirst=function(a){var b={};b.data=a;b.previous=this.sentinel;a=this.sentinel.next;b.next=a;a.previous=b;this.sentinel.next=b;this.size++};js_cols.LinkedList.prototype.addLast=function(a){var b={};b.data=a;b.next=this.sentinel;a=this.sentinel.previous;b.previous=a;a.next=b;this.sentinel.previous=b;this.size++};
js_cols.LinkedList.prototype.removeLast=function(){if(this.sentinel.previous==this.sentinel)return null;var a=this.sentinel.previous;a.previous.next=this.sentinel;this.sentinel.previous=a.previous;this.size--;return a.data};js_cols.LinkedList.prototype.removeFirst=function(){if(this.sentinel.next==this.sentinel)return null;var a=this.sentinel.next;a.next.previous=this.sentinel;this.sentinel.next=a.next;this.size--;return a.data};
js_cols.LinkedList.prototype.getFirst=function(){if(this.sentinel.next==this.sentinel)return null;return this.sentinel.next.data};js_cols.LinkedList.prototype.getLast=function(){if(this.sentinel.previous==this.sentinel)return null;return this.sentinel.previous.data};js_cols.LinkedList.prototype.removeObject=function(a){for(var b=new js_cols.LinkedList.LinkedListIterator(0,this);b.hasNext();)if(a==b.next())return b.remove(),!0;return!1};js_cols.LinkedList.prototype.remove=function(a){return this.removeObject(a)};
js_cols.LinkedList.prototype.removeIndex=function(a){(new js_cols.LinkedList.LinkedListIterator(a,this)).remove()};js_cols.LinkedList.prototype.add=function(a,b){(new js_cols.LinkedList.LinkedListIterator(a-1,this)).add(b)};js_cols.LinkedList.prototype.contains=function(a){for(var b=new js_cols.LinkedList.LinkedListIterator(0,this),c=!1;b.hasNext()&&!c;)a==b.next()&&(c=!0);return c};js_cols.LinkedList.prototype.iterator=function(a){return new js_cols.LinkedList.LinkedListIterator(a,this)};
js_cols.LinkedList.prototype.toArray=function(){for(var a=[],b=this.iterator(0);b.hasNext();)a.push(b.next());return a};js_cols.LinkedList.prototype.getValues=function(){return this.toArray()};js_cols.LinkedList.prototype.clear=function(){this.sentinel.next=this.sentinel;this.sentinel.previous=this.sentinel;this.size=0};js_cols.LinkedList.prototype.clone=function(){var a=new js_cols.LinkedList;this.forEach(a.addLast,a);return a};js_cols.LinkedList.prototype.isEmpty=function(){return this.size==0};
js_cols.LinkedList.prototype.forEach=function(a,b){for(var c=this.sentinel.next;c!=this.sentinel;c=c.next)a.call(b,c.data,c.data,this)};js_cols.LinkedList.prototype.map=function(a,b){for(var c=[],d=this.sentinel.next;d!=this.sentinel;d=d.next)c.push(a.call(b,d.data,d.data,this));return c};js_cols.LinkedList.prototype.filter=function(a,b){for(var c=[],d=this.sentinel.next;d!=this.sentinel;d=d.next)a.call(b,d.data,d.data,this)&&c.push(d.data);return c};
js_cols.LinkedList.prototype.some=function(a,b){for(var c=this.sentinel.next;c!=this.sentinel;c=c.next)if(a.call(b,c.data,c.data,this))return!0;return!1};js_cols.LinkedList.prototype.every=function(a,b){for(var c=this.sentinel.next;c!=this.sentinel;c=c.next)if(!a.call(b,c.data,c.data,this))return!1;return!0};js_cols.LinkedList.prototype.insert=function(a){this.addFirst(a)};
js_cols.LinkedList.prototype.insertAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.addLast(a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.addLast,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)this.addLast(a[b])}else if(js_cols.typeOf(a)=="object")for(b in a)this.addLast(a[b])};
js_cols.LinkedList.prototype.removeAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.removeObject(a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.removeObject,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)this.removeObject(a[b])}else if(js_cols.typeOf(a)=="object")for(b in a)this.removeObject(a[b])};
js_cols.LinkedList.prototype.containsAll=function(a){if(js_cols.typeOf(a)=="array"){for(var b=0;b<a.length;b++)if(!this.contains(a[b]))return!1;return!0}else if(js_cols.typeOf(a.forEach)=="function")return a.every(this.contains,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)if(!this.contains(a[b]))return!1;return!0}else if(js_cols.typeOf(a)=="object"){for(b in a)if(!this.contains(a[b]))return!1;return!0}};
js_cols.LinkedList.LinkedListIterator=function(a,b){this.list=b;this.position=this.list.sentinel;if(a>this.list.size||a<0)startpos=0;else if(this.list.size-a>this.list.size/2)for(i=1;i<=a;i++)this.next();else if(a!=0)for(i=this.list.size+1;i>a;i--)this.previous()};js_cols.LinkedList.LinkedListIterator.prototype.hasNext=function(){return this.position.next!=this.list.sentinel};js_cols.LinkedList.LinkedListIterator.prototype.hasPrevious=function(){return this.position.previous!=this.list.sentinel};
js_cols.LinkedList.LinkedListIterator.prototype.next=function(){if(!this.hasNext())return null;this.position=this.position.next;return this.position.data};js_cols.LinkedList.LinkedListIterator.prototype.previous=function(){if(!this.hasPrevious())return null;this.position=this.position.previous;return this.position.data};
js_cols.LinkedList.LinkedListIterator.prototype.add=function(a){var b={};b.data=a;b.next=this.position.next;this.position.next.previous=b;b.previous=this.position;this.position=this.position.next=b;this.list.size++};js_cols.LinkedList.LinkedListIterator.prototype.remove=function(){if(this.position==this.list.sentinel)return null;var a=this.position;this.position.previous.next=this.position.next;this.position=this.position.next.previous=this.position.previous;this.list.size--;return a.data};
js_cols.LinkedList.LinkedListIterator.prototype.set=function(a){if(this.position==this.list.sentinel)return!1;this.position.data=a;return!0};js_cols.HashMap=function(a){this.map_={};var b=arguments.length;if(b>1){if(b%2)throw Error("Uneven number of arguments");for(var c=0;c<b;c+=2)this.insert(arguments[c],arguments[c+1])}else a&&this.insertAll(a)};js_cols.HashMap.prototype.count_=0;js_cols.HashMap.prototype.version_=0;js_cols.HashMap.prototype.getCount=function(){return this.count_};
js_cols.HashMap.prototype.getValues=function(){var a=[],b;for(b in this.map_)a.push(this.map_[b].value);return a};js_cols.HashMap.prototype.getKeys=function(){var a=[],b;for(b in this.map_)a.push(this.map_[b].key);return a};js_cols.HashMap.prototype.containsKey=function(a){a=this.getHash_(a);return js_cols.HashMap.hasHash_(this.map_,a)};js_cols.HashMap.prototype.contains=function(a){return this.containsKey(a)};js_cols.HashMap.prototype.containsSwapped=function(a,b){return this.containsKey(b)};
js_cols.HashMap.prototype.containsValue=function(a){for(var b in this.map_)if(this.map_[b].value==a)return!0;return!1};js_cols.HashMap.prototype.defaultEquals=function(a,b){return a===b};js_cols.HashMap.prototype.equals=function(a,b){if(!(a instanceof js_cols.HashMap))return!1;if(this===a)return!0;if(this.count_!=a.getCount())return!1;var c=js_cols.typeOf(b)=="function"?b:this.defaultEquals,d;for(d in this.map_){var e=this.map_[d].key;if(!c(this.get(e),a.get(e)))return!1}return!0};
js_cols.HashMap.prototype.isEmpty=function(){return this.count_==0};js_cols.HashMap.prototype.clear=function(){this.map_={};this.version_=this.count_=this.count_=0};js_cols.HashMap.prototype.remove=function(a){a=this.getHash_(a);if(js_cols.HashMap.hasHash_(this.map_,a))return delete this.map_[a],this.count_--,this.version_++,!0;return!1};js_cols.HashMap.prototype.removeSwapped=function(a,b){this.remove(b)};
js_cols.HashMap.prototype.get=function(a,b){var c=this.getHash_(a);if(js_cols.HashMap.hasHash_(this.map_,c))return this.map_[c].value;return b};js_cols.HashMap.prototype.insert=function(a,b){var c=this.getHash_(a);js_cols.HashMap.hasHash_(this.map_,c)||(this.count_++,this.version_++);var d={};d.value=b;d.key=a;this.map_[c]=d};js_cols.HashMap.prototype.insertSwapped=function(a,b){this.insert(b,a)};
js_cols.HashMap.prototype.insertAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.insert(a[b],a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.insertSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"&&js_cols.typeOf(a.getKeys)=="function")for(var c=a.getValues(),a=a.getKeys(),b=0;b<a.length;b++)this.insert(a[b],c[b]);else if(js_cols.typeOf(a)=="object")for(b in a)this.insert(b,a[b])};
js_cols.HashMap.prototype.removeAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.remove(a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.removeSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)this.remove(a[b])}else if(js_cols.typeOf(a)=="object")for(b in a)this.remove(a[b])};
js_cols.HashMap.prototype.containsAll=function(a){if(js_cols.typeOf(a)=="array"){for(var b=0;b<a.length;b++)if(!this.containsKey(a[b]))return!1;return!0}else if(js_cols.typeOf(a.forEach)=="function")return a.every(this.containsSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)if(!this.containsKey(a[b]))return!1;return!0}else if(js_cols.typeOf(a)=="object"){for(b in a)if(!this.containsKey(b))return!1;return!0}};js_cols.HashMap.prototype.clone=function(){return new js_cols.HashMap(this)};
js_cols.HashMap.prototype.forEach=function(a,b){for(var c in this.map_)a.call(b,this.map_[c].value,this.map_[c].key,this)};js_cols.HashMap.prototype.some=function(a,b){for(var c in this.map_)if(a.call(b,this.map_[c].value,this.map_[c].key,this))return!0;return!1};js_cols.HashMap.prototype.every=function(a,b){for(var c in this.map_)if(!a.call(b,this.map_[c].value,this.map_[c].key,this))return!1;return!0};
js_cols.HashMap.prototype.map=function(a,b){var c=[],d;for(d in this.map_)c.push(a.call(b,this.map_[d].value,this.map_[d].key,this));return c};js_cols.HashMap.prototype.filter=function(a,b){var c=new js_cols.HashMap,d;for(d in this.map_)a.call(b,this.map_[d].value,this.map_[d].key,this)&&c.insert(this.map_[d].key,this.map_[d].value);return c};
js_cols.HashMap.prototype.intersection=function(a){var b=js_cols.getCount(a);!(a instanceof js_cols.HashMap)&&b>5&&(b=new js_cols.HashMap,b.insertAll(a),a=b);b=new js_cols.HashMap;if(js_cols.typeOf(a.get)=="function")for(var c in this.map_)a.get.call(a,this.map_[c].key)==this.map_[c].value&&b.insert(this.map_[c].key,this.map_[c].value);else for(c in this.map_)js_cols.contains.call(a,a,this.map_[c].key)&&b.insert(this.map_[c].key,this.map_[c].value);return b};
js_cols.HashMap.prototype.isSubmapOf=function(a){var b=js_cols.getCount(a);if(this.getCount()>b)return!1;!(a instanceof js_cols.HashMap)&&b>5&&(b=new js_cols.HashMap,b.insertAll(a),a=b);b=0;if(js_cols.typeOf(a.get)=="function")for(var c in this.map_)a.get.call(a,this.map_[c].key)==this.map_[c].value&&b++;else for(c in this.map_)js_cols.contains.call(a,a,this.map_[c].key)&&b++;return b==this.getCount()};
js_cols.HashMap.prototype.transpose=function(){var a=new js_cols.HashMap,b;for(b in this.map_)a.insert(this.map_[b].value,this.map_[b].key);return a};js_cols.HashMap.prototype.getHash_=function(a){var b=typeof a;return b=="object"&&a||b=="function"?"o"+js_cols.getUid(a):b.substr(0,1)+a};js_cols.HashMap.hasHash_=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};
js_cols.HashMultiMap=function(a){this.map_={};var b=arguments.length;if(b>1){if(b%2)throw Error("Uneven number of arguments");for(var c=0;c<b;c+=2)this.insert(arguments[c],arguments[c+1])}else a&&this.insertAll(a)};js_cols.HashMultiMap.prototype.count_=0;js_cols.HashMultiMap.prototype.getCount=function(){return this.count_};js_cols.HashMultiMap.prototype.getValues=function(){var a=[],b;for(b in this.map_)for(var c=this.map_[b];c;)a.push(c.value),c=c.next;return a};
js_cols.HashMultiMap.prototype.getKeys=function(){var a=[],b;for(b in this.map_)for(var c=this.map_[b];c;)a.push(c.key),c=c.next;return a};js_cols.HashMultiMap.prototype.containsKey=function(a){var b=this.getHash_(a);if(js_cols.HashMultiMap.hasHash_(this.map_,b))return this.getAllValuesForKey(a).length;return 0};js_cols.HashMultiMap.prototype.contains=function(a){return this.containsKey(a)};js_cols.HashMultiMap.prototype.containsSwapped=function(a,b){return this.containsKey(b)};
js_cols.HashMultiMap.prototype.containsValue=function(a){for(var b in this.map_)if(this.map_[b].value==a)return!0;return!1};
js_cols.HashMultiMap.prototype.equals=function(a,b){if(!(a instanceof js_cols.HashMultiMap))return!1;if(this===a)return!0;if(this.count_!=a.getCount())return!1;var c=js_cols.typeOf(b)=="function"?b:this.defaultEquals,d;for(d in this.map_){var e=this.map_[d].key;thisVals=this.getAllValuesForKey(e);otherVals=a.getAllValuesForKey(e);if(thisVals.length!=otherVals.length)return!1;for(e=0;e<thisVals.length;e++)if(!c(thisVals[e],otherVals[e]))return!1}return!0};
js_cols.HashMultiMap.prototype.defaultEquals=function(a,b){return a===b};js_cols.HashMultiMap.prototype.isEmpty=function(){return this.count_==0};js_cols.HashMultiMap.prototype.clear=function(){this.map_={};this.count_=this.count_=0};js_cols.HashMultiMap.prototype.remove=function(a){a=this.getHash_(a);if(js_cols.HashMultiMap.hasHash_(this.map_,a)){var b=this.map_[a];b.next?this.map_[a]=b.next:delete this.map_[a];this.count_--;return!0}return!1};
js_cols.HashMultiMap.prototype.removeAllValuesForKey=function(a){for(var b=this.remove(a),c=b;b;)b=this.remove(a);return c};js_cols.HashMultiMap.prototype.get=function(a,b){var c=this.getHash_(a);if(js_cols.HashMultiMap.hasHash_(this.map_,c))return this.map_[c].value;return b};js_cols.HashMultiMap.prototype.getAllValuesForKey=function(a,b){var c=this.getHash_(a),d=[];if(js_cols.HashMultiMap.hasHash_(this.map_,c)){for(c=this.map_[c];c;)d.push(c.value),c=c.next;return d}return b};
js_cols.HashMultiMap.prototype.insert=function(a,b){var c=this.getHash_(a);this.map_[c]=js_cols.HashMultiMap.hasHash_(this.map_,c)?{key:a,value:b,next:this.map_[c]}:{key:a,value:b};this.count_++};js_cols.HashMultiMap.prototype.insertSwapped=function(a,b){this.insert(b,a)};js_cols.HashMultiMap.prototype.insertValuesForKey=function(a,b){for(var c=0;c<b.length;c++)this.insert(a,b[c])};
js_cols.HashMultiMap.prototype.insertAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.insert(a[b],a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.insertSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"&&js_cols.typeOf(a.getKeys)=="function")for(var c=a.getValues(),a=a.getKeys(),b=0;b<a.length;b++)this.insert(a[b],c[b]);else if(js_cols.typeOf(a)=="object")for(b in a)this.insert(b,a[b])};
js_cols.HashMultiMap.prototype.removeAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.removeAllValuesForKey(a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.removeAllValuesForKey,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)this.removeAllValuesForKey(a[b])}else if(js_cols.typeOf(a)=="object")for(b in a)this.removeAllValuesForKey(a[b])};
js_cols.HashMultiMap.prototype.containsAll=function(a){if(js_cols.typeOf(a)=="array"){for(var b=0;b<a.length;b++)if(!this.containsKey(a[b]))return!1;return!0}else if(js_cols.typeOf(a.forEach)=="function")return a.every(this.containsSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)if(!this.containsKey(a[b]))return!1;return!0}else if(js_cols.typeOf(a)=="object"){for(b in a)if(!this.contains(b))return!1;return!0}};
js_cols.HashMultiMap.prototype.forEach=function(a,b){for(var c in this.map_)for(var d=this.map_[c];d;)a.call(b,d.value,d.key,this),d=d.next};js_cols.HashMultiMap.prototype.some=function(a,b){for(var c in this.map_)for(var d=this.map_[c];d;){if(a.call(b,d.value,d.key,this))return!0;d=d.next}return!1};js_cols.HashMultiMap.prototype.every=function(a,b){for(var c in this.map_)for(var d=this.map_[c];d;){if(!a.call(b,d.value,d.key,this))return!1;d=d.next}return!0};
js_cols.HashMultiMap.prototype.map=function(a,b){var c=[],d;for(d in this.map_)for(var e=this.map_[d];e;)c.push(a.call(b,e.value,e.key,this)),e=e.next;return c};js_cols.HashMultiMap.prototype.filter=function(a,b){var c=new js_cols.HashMultiMap,d;for(d in this.map_)for(var e=this.map_[d];e;)a.call(b,e.value,e.key,this)&&c.insert(e.key,e.value),e=e.next;return c};js_cols.HashMultiMap.prototype.clone=function(){return new js_cols.HashMultiMap(this)};
js_cols.HashMultiMap.prototype.getHash_=function(a){var b=typeof a;return b=="object"&&a||b=="function"?"o"+js_cols.getUid(a):b.substr(0,1)+a};js_cols.HashMultiMap.hasHash_=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};js_cols.HashBag=function(a){this.map_=new js_cols.HashMultiMap;var b=arguments.length;if(b>1){if(b%2)throw Error("Uneven number of arguments");for(var c=0;c<b;c+=2)this.insert(arguments[c],arguments[c+1])}else a&&this.insertAll(a)};
js_cols.HashBag.prototype.insert=function(a){this.map_.insert(a,a)};js_cols.HashBag.prototype.insertAll=function(a){this.map_.insertAll(a)};js_cols.HashBag.prototype.getCount=function(){return this.map_.getCount()};js_cols.HashBag.prototype.removeAll=function(a){this.map_.removeAll(a)};js_cols.HashBag.prototype.remove=function(a){return this.map_.remove(a)};js_cols.HashBag.prototype.clear=function(){this.map_.clear()};js_cols.HashBag.prototype.isEmpty=function(){return this.map_.isEmpty()};
js_cols.HashBag.prototype.contains=function(a){return this.map_.containsKey(a)};js_cols.HashBag.prototype.containsAll=function(a){return this.map_.containsAll(a)};js_cols.HashBag.prototype.intersection=function(a){var b=js_cols.getCount(a);!(a instanceof js_cols.HashBag)&&b>5&&(b=new js_cols.HashBag,b.insertAll(a),a=b);var b=new js_cols.HashBag,c;for(c in this.map_.map_)js_cols.contains.call(a,a,this.map_.map_[c].key)&&b.insert(this.map_.map_[c].value);return b};
js_cols.HashBag.prototype.isSubsetOf=function(a){var b=js_cols.getCount(a);if(this.getCount()>b)return!1;!(a instanceof js_cols.HashBag)&&b>5&&(a=new js_cols.HashBag(a));return this.every(function(b){return js_cols.contains.call(a,a,b)})};js_cols.HashBag.prototype.getValues=function(){return this.map_.getValues()};js_cols.HashBag.prototype.clone=function(){return new js_cols.HashBag(this)};js_cols.HashBag.prototype.forEach=function(a,b){this.map_.forEach(a,b)};
js_cols.HashBag.prototype.some=function(a,b){return this.map_.some(a,b)};js_cols.HashBag.prototype.every=function(a,b){return this.map_.every(a,b)};js_cols.HashBag.prototype.filter=function(a,b){return(new this.map_.filter(a,b)).getValues()};js_cols.HashBag.prototype.map=function(a,b){return this.map_.map(a,b)};js_cols.HashBag.prototype.equals=function(a){if(!(a instanceof js_cols.HashBag))return!1;return this.map_.equals(a.map_)};js_cols.HashSet=function(a){this.map_=new js_cols.HashMap;a&&this.insertAll(a)};
js_cols.HashSet.prototype.insert=function(a){this.map_.insert(a,a)};js_cols.HashSet.prototype.insertAll=function(a){this.map_.insertAll(a)};js_cols.HashSet.prototype.getCount=function(){return this.map_.getCount()};js_cols.HashSet.prototype.removeAll=function(a){this.map_.removeAll(a)};js_cols.HashSet.prototype.remove=function(a){return this.map_.remove(a)};js_cols.HashSet.prototype.clear=function(){this.map_.clear()};js_cols.HashSet.prototype.isEmpty=function(){return this.map_.isEmpty()};
js_cols.HashSet.prototype.contains=function(a){return this.map_.containsKey(a)};js_cols.HashSet.prototype.containsAll=function(a){return this.map_.containsAll(a)};js_cols.HashSet.prototype.intersection=function(a){return this.map_.intersection(a)};js_cols.HashSet.prototype.getValues=function(){return this.map_.getValues()};js_cols.HashSet.prototype.clone=function(){return new js_cols.HashSet(this)};js_cols.HashSet.prototype.forEach=function(a,b){this.map_.forEach(a,b)};
js_cols.HashSet.prototype.some=function(a,b){return this.map_.some(a,b)};js_cols.HashSet.prototype.every=function(a,b){return this.map_.every(a,b)};js_cols.HashSet.prototype.map=function(a,b){return this.map_.map(a,b)};js_cols.HashSet.prototype.filter=function(a,b){return(new this.map_.filter(a,b)).getValues()};js_cols.HashSet.prototype.equals=function(a){return this.getCount()==js_cols.getCount(a)&&this.isSubsetOf(a)};js_cols.HashSet.prototype.isSubsetOf=function(a){return this.map_.isSubmapOf(a)};
js_cols.IntervalHeap=function(a){this.heap=[];this.count=this.n=0;this.compare=a||this.default_compare};js_cols.IntervalHeap.prototype.getCount=function(){return this.count};js_cols.IntervalHeap.prototype.clear=function(){this.heap=[];this.n=this.count=0};js_cols.IntervalHeap.prototype.isEmpty=function(){return this.getCount()==0};
js_cols.IntervalHeap.prototype.clone=function(){var a=new js_cols.IntervalHeap(this.compare);if(this.isEmpty())return a;for(var b=[],c=Math.floor(this.getCount()/2),d=1;d<=c;d++)if(this.heap[d])b[d]={left:{},right:{}},b[d].left.key=this.heap[d].left.key,b[d].left.value=this.heap[d].left.value,b[d].right.key=this.heap[d].right.key,b[d].right.value=this.heap[d].right.value;c++;if(this.heap[c])b[c]={left:{}},b[c].left.key=this.heap[c].left.key,b[c].left.value=this.heap[c].left.value;a.heap=b;a.n=this.n;
a.count=this.count;return a};js_cols.IntervalHeap.prototype.getKeys=function(){var a=[];if(this.isEmpty())return a;for(var b=Math.floor(this.getCount()/2),c=1;c<=b;c++)this.heap[c]&&(a.push(this.heap[c].left.key),a.push(this.heap[c].right.key));b++;this.heap[b]&&a.push(this.heap[b].left.key);return a};
js_cols.IntervalHeap.prototype.getValues=function(){var a=[];if(this.isEmpty())return a;for(var b=Math.floor(this.getCount()/2),c=1;c<=b;c++)this.heap[c]&&(a.push(this.heap[c].left.value),a.push(this.heap[c].right.value));b++;this.heap[b]&&a.push(this.heap[b].left.value);return a};
js_cols.IntervalHeap.prototype.insertAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.insert(a[b],a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.insertSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"&&js_cols.typeOf(a.getKeys)=="function")for(var c=a.getValues(),a=a.getKeys(),b=0;b<a.length;b++)this.insert(a[b],c[b]);else if(js_cols.typeOf(a)=="object")for(b in a)this.insert(b,a[b])};
js_cols.IntervalHeap.prototype.insertSwapped=function(a,b){this.insert(b,a)};js_cols.IntervalHeap.prototype.min=function(){return this.n>0?this.heap[1].left.value:null};js_cols.IntervalHeap.prototype.max=function(){return this.n>0&&this.heap[1].right?this.heap[1].right.value:this.n===1?this.heap[1].left.value:null};js_cols.IntervalHeap.prototype.default_compare=function(a,b){return a<b?-1:b<a?1:0};
js_cols.IntervalHeap.prototype.insert=function(a,b){var c=new js_cols.IntervalHeap.Handle(a,b,this.n,this);if(this.n>0)if(this.heap[this.n].right==null){var d=this.heap[this.n].left;this.compare(d.key,c.key)<=0?this.heap[this.n].right=c:(this.heap[this.n].left=c,this.heap[this.n].right=d)}else this.n++,c.index=this.n,this.heap[this.n]={},this.heap[this.n].left=c;else this.n++,c.index=this.n,this.heap[this.n]={},this.heap[this.n].left=c;d=Math.floor(this.n/2);this.n>1&&(this.compare(this.heap[d].left.key,
this.heap[this.n].left.key)>0?this.siftUpMin(this.n):this.heap[this.n].right!=null&&this.compare(this.heap[d].right.key,this.heap[this.n].right.key)<0?this.siftUpMax(this.n):this.compare(this.heap[d].right.key,this.heap[this.n].left.key)<0&&this.siftUpMax(this.n));this.count++;return c};
js_cols.IntervalHeap.prototype.deleteMin=function(){if(this.n<=0)return null;var a=this.heap[1].left.value;this.heap[1].left.container=void 0;this.heap[this.n].left.index=1;this.heap[1].left=this.heap[this.n].left;this.heap[this.n].right==null?(this.heap.pop(),this.n--):(this.heap[this.n].left=this.heap[this.n].right,this.heap[this.n].right=null);this.siftDownMin(1);this.count--;return a};
js_cols.IntervalHeap.prototype.deleteMax=function(){if(this.n<=0)return null;if(this.heap[1].right!=null){var a=this.heap[1].right.value;this.heap[1].right.container=null;this.heap[this.n].right!=null?(this.heap[this.n].right.index=1,this.heap[1].right=this.heap[this.n].right,this.heap[this.n].right=null):(this.heap[this.n].left.index=1,this.heap[1].right=this.heap[this.n].left,this.heap.pop(),this.n--);this.siftDownMax(1);this.count--;return a}else return this.deleteMin()};
js_cols.IntervalHeap.prototype.changeKey=function(a,b){if(!this.containedInThisQueue(a))return!1;var c=a.index,d=Math.floor(c/2);this.heap[c].left===a?this.heap[c].left.key=b:this.heap[c].right.key=b;c<this.n||this.heap[c].right?(this.compare(this.heap[c].left.key,this.heap[c].right.key)>0&&this.swapSides(c),c>1&&this.compare(this.heap[d].left.key,this.heap[c].left.key)>0?this.siftUpMin(c):this.siftDownMin(c),c>1&&this.compare(this.heap[d].right.key,this.heap[c].right.key)<0?this.siftUpMax(c):this.siftDownMax(c)):
c>1&&this.compare(this.heap[d].left.key,this.heap[c].left.key)>0?this.siftUpMin(c):c>1&&this.compare(this.heap[d].right.key,this.heap[c].left.key)<0&&this.siftUpMax(c);return!0};
js_cols.IntervalHeap.prototype.remove=function(a){if(!this.containedInThisQueue(a))return!1;var b=a.index,c=!1;this.heap[b].left==a&&(c=!0);c?(this.heap[b].left.container=null,this.heap[b].left=this.heap[this.n].left,this.heap[b].left.index=b,this.heap[this.n].left=null,this.siftDownMin(b),this.heap[this.n].right==null?(this.heap.pop(),this.n--):this.swapSides(this.n)):(this.heap[this.n].right!=null?(this.heap[b].right.container=null,this.heap[b].right=this.heap[this.n].right,this.heap[b].right.index=
b,this.heap[this.n].right=null):(this.heap[b].right.container=null,this.heap[b].right=this.heap[this.n].left,this.heap[b].right.index=b,this.heap[this.n]=null,this.n--),this.siftDownMax(b));this.count--;return!0};js_cols.IntervalHeap.prototype.siftUpMin=function(a){var b=Math.floor(a/2);a==1||this.compare(this.heap[b].left.key,this.heap[a].left.key)<=0||(this.swapLeft(b,a),this.siftUpMin(b))};
js_cols.IntervalHeap.prototype.siftDownMin=function(a){if(2*a<=this.n){var b=2*a+1>this.n||!this.heap[2*a+1].left||this.compare(this.heap[2*a].left.key,this.heap[2*a+1].left.key)<=0?2*a:2*a+1;this.compare(this.heap[a].left.key,this.heap[b].left.key)>0&&(this.swapLeft(a,b),this.heap[b].right&&this.compare(this.heap[b].left.key,this.heap[b].right.key)>0&&this.swapSides(b),this.siftDownMin(b))}};
js_cols.IntervalHeap.prototype.siftUpMax=function(a){var b=Math.floor(a/2);if(a<this.n||this.heap[this.n].right!=null){if(a==1||this.compare(this.heap[b].right.key,this.heap[a].right.key)>=0)return;this.swapRight(b,a)}else{if(a==1||this.compare(this.heap[b].right.key,this.heap[a].left.key)>=0)return;this.heap[b].right.index=a;this.heap[a].left.index=b;var c=this.heap[b].right;this.heap[b].right=this.heap[a].left;this.heap[a].left=c}this.siftUpMax(b)};
js_cols.IntervalHeap.prototype.siftDownMax=function(a){if(2*a<=this.n){var b=2*a+1>this.n||this.heap[2*a+1].right==null||this.compare(this.heap[2*a].right.key,this.heap[2*a+1].right.key)>0?2*a:2*a+1;this.heap[b].right!=null&&this.compare(this.heap[a].right.key,this.heap[b].right.key)<0&&(this.swapRight(a,b),this.compare(this.heap[b].left.key,this.heap[b].right.key)>0&&this.swapSides(b),this.siftDownMax(b))}};
js_cols.IntervalHeap.prototype.swapLeft=function(a,b){this.heap[a].left.index=b;this.heap[b].left.index=a;var c=this.heap[a].left;this.heap[a].left=this.heap[b].left;this.heap[b].left=c};js_cols.IntervalHeap.prototype.swapRight=function(a,b){this.heap[a].right.index=b;this.heap[b].right.index=a;var c=this.heap[a].right;this.heap[a].right=this.heap[b].right;this.heap[b].right=c};
js_cols.IntervalHeap.prototype.swapSides=function(a){var b=this.heap[a].left;this.heap[a].left=this.heap[a].right;this.heap[a].right=b};js_cols.IntervalHeap.prototype.containedInThisQueue=function(a){return a.container===this?!0:!1};js_cols.IntervalHeap.Handle=function(a,b,c,d){this.key=a;this.value=b;this.index=c;this.container=d};js_cols.LinkedHashMap=function(a,b){this.list_=new js_cols.LinkedList;this.augmentList();this.map_=new js_cols.HashMap;this.maxCount_=a;this.isCache_=b};
js_cols.LinkedHashMap.prototype.augmentList=function(){this.list_.insertAfter=function(a,b){b.next=a.next;b.previous=a;a.next.previous=b;a.next=b;this.size++};this.list_.insertBefore=function(a,b){b.next=a;b.previous=a.previous;a.previous.next=b;a.previous=b;this.size++};this.list_.removeFromList=function(a){a.previous.next=a.next;a.next.previous=a.previous;this.size--}};
js_cols.LinkedHashMap.prototype.findAndMoveToTop_=function(a){if((a=this.map_.get(a))&&this.isCache_)this.list_.removeFromList(a),this.insert_(a);return a};js_cols.LinkedHashMap.prototype.insert=function(a,b){var c=this.findAndMoveToTop_(a);c?c.data=b:(c={key:a,data:b},this.map_.insert(a,c),this.insert_(c))};js_cols.LinkedHashMap.prototype.insertSwapped=function(a,b){this.insert(b,a)};
js_cols.LinkedHashMap.prototype.insertAfter=function(a,b,c){if((a=this.map_.get(a))&&!this.isCache_)return c={key:b,data:c},this.list_.insertAfter(a,c),this.map_.insert(b,c),this.maxCount_!=null&&this.truncate_(this.maxCount_),!0;return!1};js_cols.LinkedHashMap.prototype.insertBefore=function(a,b,c){if((a=this.map_.get(a))&&!this.isCache_)return c={key:b,data:c},this.list_.insertBefore(a,c),this.map_.insert(b,c),this.maxCount_!=null&&this.truncate_(this.maxCount_),!0;return!1};
js_cols.LinkedHashMap.prototype.insertAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.insert(a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.insertSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"&&js_cols.typeOf(a.getKeys)=="function")for(var c=a.getValues(),a=a.getKeys(),b=0;b<a.length;b++)this.insert(a[b],c[b]);else if(js_cols.typeOf(a)=="object")for(b in a)this.insert(b,a[b])};
js_cols.LinkedHashMap.prototype.removeAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.remove(a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.removeSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)this.remove(a[b])}else if(js_cols.typeOf(a)=="object")for(b in a)this.remove(a[b])};
js_cols.LinkedHashMap.prototype.containsAll=function(a){if(js_cols.typeOf(a)=="array"){for(var b=0;b<a.length;b++)if(!this.containsKey(a[b]))return!1;return!0}else if(js_cols.typeOf(a.forEach)=="function")return a.every(this.containsSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)if(!this.containsKey(a[b]))return!1;return!0}else if(js_cols.typeOf(a)=="object"){for(b in a)if(!this.containsKey(b))return!1;return!0}};
js_cols.LinkedHashMap.prototype.get=function(a,b){var c=this.findAndMoveToTop_(a);return c?c.data:b};js_cols.LinkedHashMap.prototype.peekValue=function(a,b){var c=this.map_.get(a);return c?c.data:b};js_cols.LinkedHashMap.prototype.peek=function(){return this.list_.getFirst()};js_cols.LinkedHashMap.prototype.peekLast=function(){return this.list_.getLast()};js_cols.LinkedHashMap.prototype.shift=function(){return this.popNode_(this.list_.sentinel.next)};js_cols.LinkedHashMap.prototype.pop=function(){return this.popNode_(this.list_.sentinel.previous)};
js_cols.LinkedHashMap.prototype.remove=function(a){if(a=this.map_.get(a))return this.removeNode(a),!0;return!1};js_cols.LinkedHashMap.prototype.removeSwapped=function(a,b){this.remove(b)};js_cols.LinkedHashMap.prototype.removeNode=function(a){this.list_.removeFromList(a);this.map_.remove(a.key)};js_cols.LinkedHashMap.prototype.getCount=function(){return this.map_.getCount()};js_cols.LinkedHashMap.prototype.isEmpty=function(){return this.map_.isEmpty()};
js_cols.LinkedHashMap.prototype.setMaxCount=function(a){this.maxCount_=a||null;this.maxCount_!=null&&this.truncate_(this.maxCount_)};js_cols.LinkedHashMap.prototype.getValues=function(){return this.list_.getValues()};js_cols.LinkedHashMap.prototype.getKeys=function(){return this.map(function(a,b){return b})};js_cols.LinkedHashMap.prototype.containsValue=function(a){return this.list_.contains(a)};js_cols.LinkedHashMap.prototype.containsKey=function(a){return this.map_.containsKey(a)};
js_cols.LinkedHashMap.prototype.contains=function(a){return this.containsKey(a)};js_cols.LinkedHashMap.prototype.containsSwapped=function(a,b){return this.containsKey(b)};js_cols.LinkedHashMap.prototype.clear=function(){this.truncate_(0)};js_cols.LinkedHashMap.prototype.clone=function(){var a=new js_cols.LinkedHashMap(this.maxCount_,this.isCache_);a.insertAll(this);return a};
js_cols.LinkedHashMap.prototype.forEach=function(a,b){for(var c=this.list_.sentinel.next;c!=this.list_.sentinel;c=c.next)a.call(b,c.data,c.key,this)};js_cols.LinkedHashMap.prototype.map=function(a,b){for(var c=[],d=this.list_.sentinel.next;d!=this.list_.sentinel;d=d.next)c.push(a.call(b,d.data,d.key,this));return c};
js_cols.LinkedHashMap.prototype.filter=function(a,b){for(var c=new js_cols.LinkedHashMap(this.maxCount_,this.isCache_),d=this.list_.sentinel.next;d!=this.list_.sentinel;d=d.next)a.call(b,d.data,d.key,this)&&c.insert(d.key,d.data);return c};js_cols.LinkedHashMap.prototype.some=function(a,b){for(var c=this.list_.sentinel.next;c!=this.list_.sentinel;c=c.next)if(a.call(b,c.data,c.key,this))return!0;return!1};
js_cols.LinkedHashMap.prototype.every=function(a,b){for(var c=this.list_.sentinel.next;c!=this.list_.sentinel;c=c.next)if(!a.call(b,c.data,c.key,this))return!1;return!0};
js_cols.LinkedHashMap.prototype.intersection=function(a){var b=new js_cols.LinkedHashMap(this.maxCount_,this.isCache_);if(js_cols.typeOf(a.get)=="function")for(var c=this.list_.sentinel.next;c!=this.list_.sentinel;c=c.next)a.get.call(a,c.key)==c.data&&b.insert(c.key,c.data);else for(c=this.list_.sentinel.next;c!=this.list_.sentinel;c=c.next)js_cols.contains.call(a,a,c.key)&&b.insert(c.key,c.data);return b};
js_cols.LinkedHashMap.prototype.isSubmapOf=function(a){var b=0;if(js_cols.typeOf(a.get)=="function")for(var c=this.list_.sentinel.next;c!=this.list_.sentinel;c=c.next)a.get.call(a,c.key)==c.data&&b++;else for(c=this.list_.sentinel.next;c!=this.list_.sentinel;c=c.next)js_cols.contains.call(a,a,c.key)&&b++;return b==this.getCount()};
js_cols.LinkedHashMap.prototype.insert_=function(a){this.isCache_?this.list_.insertAfter(this.list_.sentinel,a):this.list_.insertBefore(this.list_.sentinel,a);this.maxCount_!=null&&this.truncate_(this.maxCount_)};js_cols.LinkedHashMap.prototype.truncate_=function(a){for(var b=this.map_.getCount();b>a;b--)this.removeNode(this.isCache_?this.list_.sentinel.previous:this.list_.sentinel.next)};js_cols.LinkedHashMap.prototype.popNode_=function(a){this.list_.sentinel!=a&&this.removeNode(a);return a.data};
js_cols.LinkedHashMap.prototype.iterator=function(a){var b=this.list_.iterator(0);delete b.add;delete b.remove;delete b.set;if(a=this.map_.get(a,!1))b.position=a;return b};js_cols.Queue=function(){js_cols.LinkedList.call(this)};js_cols.inherits(js_cols.Queue,js_cols.LinkedList);js_cols.Queue.prototype.enqueue=function(a){this.addLast(a)};js_cols.Queue.prototype.dequeue=function(){return this.removeFirst()};js_cols.Queue.prototype.peek=function(){return this.getFirst()};
js_cols.Queue.prototype.remove=function(a){return this.removeObject(a)};js_cols.Stack=function(){js_cols.LinkedList.call(this)};js_cols.inherits(js_cols.Stack,js_cols.LinkedList);js_cols.Stack.prototype.push=function(a){this.addFirst(a)};js_cols.Stack.prototype.pop=function(){return this.removeFirst()};js_cols.Stack.prototype.peek=function(){return this.getFirst()};js_cols.Stack.prototype.remove=function(a){return this.removeObject(a)};js_cols.RBnode=function(a){this.tree=a;this.left=this.right=this.tree.sentinel};
js_cols.RedBlackMap=function(a){this.RED=!0;this.BLACK=!1;this.size=0;this.sentinel=new js_cols.RBnode(this);this.sentinel.color=this.BLACK;this.root=this.sentinel;this.root.parent=this.sentinel;js_cols.RedBlackMap.prototype.compare=a||this.default_compare};js_cols.RedBlackMap.prototype.default_compare=function(a,b){return a<b?-1:b<a?1:0};js_cols.RedBlackMap.prototype.clone=function(){var a=new js_cols.RedBlackMap(this.compare);a.insertAll(this);return a};
js_cols.RedBlackMap.prototype.clear=function(){this.size=0;this.sentinel=new js_cols.RBnode(this);this.sentinel.color=this.BLACK;this.root=this.sentinel;this.root.parent=this.sentinel};js_cols.RedBlackMap.prototype.leftRotate=function(a){var b=a.right;a.right=b.left;if(b.left!=this.sentinel)b.left.parent=a;b.parent=a.parent;a.parent==this.sentinel?this.root=b:a==a.parent.left?a.parent.left=b:a.parent.right=b;b.left=a;a.parent=b};
js_cols.RedBlackMap.prototype.rightRotate=function(a){var b=a.left;a.left=b.right;if(b.right!=this.sentinel)b.right.parent=a;b.parent=a.parent;a.parent==this.sentinel?this.root=b:a==a.parent.right?a.parent.right=b:a.parent.left=b;b.right=a;a.parent=b};
js_cols.RedBlackMap.prototype.insert=function(a,b){if(this.contains(a))this.get_(a).value=b;else{var c=new js_cols.RBnode(this);c.key=a;c.value=b;for(var d=this.sentinel,e=this.root;e!=this.sentinel;)d=e,e=this.compare(c.key,e.key)<0?e.left:e.right;c.parent=d;d==this.sentinel?this.root=c:this.compare(c.key,d.key)<0?d.left=c:d.right=c;c.left=this.sentinel;c.right=this.sentinel;c.color=this.RED;this.insertFixup(c);this.size++}};
js_cols.RedBlackMap.prototype.insertSwapped=function(a,b){this.insert(b,a)};
js_cols.RedBlackMap.prototype.insertFixup=function(a){for(;a!=this.sentinel&&a!=this.root&&a.parent.color==this.RED;)if(a.parent==a.parent.parent.left){var b=a.parent.parent.right;if(b.color==this.RED)a.parent.color=this.BLACK,b.color=this.BLACK,a.parent.parent.color=this.RED,a=a.parent.parent;else{if(a==a.parent.right)a=a.parent,this.leftRotate(a);a.parent.color=this.BLACK;a.parent.parent.color=this.RED;a.parent.parent!=this.sentinel&&this.rightRotate(a.parent.parent)}}else if(b=a.parent.parent.left,
b.color==this.RED)a.parent.color=this.BLACK,b.color=this.BLACK,a.parent.parent.color=this.RED,a=a.parent.parent;else{if(a==a.parent.left)a=a.parent,this.rightRotate(a);a.parent.color=this.BLACK;a.parent.parent.color=this.RED;a.parent.parent!=this.sentinel&&this.leftRotate(a.parent.parent)}this.root.color=this.BLACK};
js_cols.RedBlackMap.prototype.delete_=function(a){var b,c;b=a.left==this.sentinel||a.right==this.sentinel?a:this.successor_(a);c=b.left!=this.sentinel?b.left:b.right;c.parent=b.parent;b.parent==this.sentinel?this.root=c:b==b.parent.left?b.parent.left=c:b.parent.right=c;if(b!=a)a.key=b.key,a.value=b.value;b.color==this.BLACK&&this.deleteFixup(c);this.size--};
js_cols.RedBlackMap.prototype.deleteFixup=function(a){for(;a!=this.root&&a.color==this.BLACK;)if(a==a.parent.left){var b=a.parent.right;if(b.color==this.RED)b.color=this.BLACK,a.parent.color=this.RED,this.leftRotate(a.parent),b=a.parent.right;if(b.left.color==this.BLACK&&b.right.color==this.BLACK)b.color=this.RED,a=a.parent;else{if(b.right.color==this.BLACK)b.left.color=this.BLACK,b.color=this.RED,this.rightRotate(b),b=a.parent.right;b.color=a.parent.color;a.parent.color=this.BLACK;b.right.color=
this.BLACK;this.leftRotate(a.parent);a=this.root}}else{b=a.parent.left;if(b.color==this.RED)b.color=this.BLACK,a.parent.color=this.RED,this.rightRotate(a.parent),b=a.parent.left;if(b.right.color==this.BLACK&&b.left.color==this.BLACK)b.color=this.RED,a=a.parent;else{if(b.left.color==this.BLACK)b.right.color=this.BLACK,b.color=this.RED,this.leftRotate(b),b=a.parent.left;b.color=a.parent.color;a.parent.color=this.BLACK;b.left.color=this.BLACK;this.rightRotate(a.parent);a=this.root}}a.color=this.BLACK};
js_cols.RedBlackMap.prototype.remove=function(a){a=this.get_(a);if(a!=this.sentinel){var b=a.value;this.delete_(a);return b}else return null};js_cols.RedBlackMap.prototype.removeSwapped=function(a,b){this.remove(b)};js_cols.RedBlackMap.prototype.min=function(a){for(;a.left!=this.sentinel;)a=a.left;return a};js_cols.RedBlackMap.prototype.max=function(a){for(;a.right!=this.sentinel;)a=a.right;return a};
js_cols.RedBlackMap.prototype.successor_=function(a){if(a.right!=this.sentinel)return this.min(a.right);for(var b=a.parent;b!=this.sentinel&&a==b.right;)a=b,b=b.parent;return b};js_cols.RedBlackMap.prototype.predecessor_=function(a){if(a.left!=this.sentinel)return this.max(a.left);for(var b=a.parent;b!=this.sentinel&&a==b.left;)a=b,b=b.parent;return b};
js_cols.RedBlackMap.prototype.successor=function(a){if(this.size>0){a=this.get_(a);if(a==this.sentinel)return null;if(a.right!=this.sentinel)return this.min(a.right).value;for(var b=a.parent;b!=this.sentinel&&a==b.right;)a=b,b=b.parent;return b!=this.sentinel?b.value:null}else return null};
js_cols.RedBlackMap.prototype.predecessor=function(a){if(this.size>0){a=this.get_(a);if(a==this.sentinel)return null;if(a.left!=this.sentinel)return this.max(a.left).value;for(var b=a.parent;b!=this.sentinel&&a==b.left;)a=b,b=b.parent;return b!=this.sentinel?b.value:null}else return null};js_cols.RedBlackMap.prototype.getMin=function(){return this.min(this.root).value};js_cols.RedBlackMap.prototype.getMax=function(){return this.max(this.root).value};
js_cols.RedBlackMap.prototype.get_=function(a){for(var b=this.root;b!=this.sentinel&&this.compare(b.key,a)!=0;)b=this.compare(a,b.key)<0?b.left:b.right;return b};js_cols.RedBlackMap.prototype.get=function(a){for(var b=this.root;b!=this.sentinel&&this.compare(b.key,a)!=0;)b=this.compare(a,b.key)<0?b.left:b.right;return b.value};js_cols.RedBlackMap.prototype.contains=function(a){return this.get_(a).key!=null};js_cols.RedBlackMap.prototype.containsSwapped=function(a,b){return this.contains(b)};
js_cols.RedBlackMap.prototype.getValues=function(){var a=[];this.traverse(function(b){a.push(b)});return a};js_cols.RedBlackMap.prototype.getKeys=function(){var a=[];if(this.isEmpty())return a;for(var b=this.min(this.root);b!=this.sentinel;)a.push(b.key),b=b=this.successor_(b);return a};
js_cols.RedBlackMap.prototype.insertAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.insert(a[b],a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.insertSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"&&js_cols.typeOf(a.getKeys)=="function")for(var c=a.getValues(),a=a.getKeys(),b=0;b<a.length;b++)this.insert(a[b],c[b]);else if(js_cols.typeOf(a)=="object")for(b in a)this.insert(b,a[b])};
js_cols.RedBlackMap.prototype.removeAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.remove(a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.removeSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)this.remove(a[b])}else if(js_cols.typeOf(a)=="object")for(b in a)this.remove(a[b])};
js_cols.RedBlackMap.prototype.containsAll=function(a){if(js_cols.typeOf(a)=="array"){for(var b=0;b<a.length;b++)if(!this.contains(a[b]))return!1;return!0}else if(js_cols.typeOf(a.every)=="function")return a.every(this.containsSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)if(!this.contains(a[b]))return!1;return!0}else if(js_cols.typeOf(a)=="object"){for(b in a)if(!this.contains(b))return!1;return!0}};
js_cols.RedBlackMap.prototype.forEach=function(a,b){if(!this.isEmpty())for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))a.call(b,c.value,c.key,this)};js_cols.RedBlackMap.prototype.some=function(a,b){if(this.isEmpty())return!1;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))if(a.call(b,c.value,c.key,this))return!0;return!1};
js_cols.RedBlackMap.prototype.every=function(a,b){if(this.isEmpty())return!1;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))if(!a.call(b,c.value,c.key,this))return!1;return!0};js_cols.RedBlackMap.prototype.map=function(a,b){var c=[];if(this.isEmpty())return c;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))c.push(a.call(b,d.value,d.key,this));return c};
js_cols.RedBlackMap.prototype.filter=function(a,b){var c=new js_cols.RedBlackMap(this.compare);if(this.isEmpty())return c;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))a.call(b,d.value,d.key,this)&&c.insert(d.key,d.value);return c};
js_cols.RedBlackMap.prototype.intersection=function(a){var b=new js_cols.RedBlackMap(this.compare);if(this.isEmpty())return b;if(js_cols.typeOf(a.get)=="function")for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))a.get.call(a,c.key)==c.value&&b.insert(c.key,c.value);else for(c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))js_cols.contains.call(a,a,c.key)&&b.insert(c.key,c.value);return b};
js_cols.RedBlackMap.prototype.isSubmapOf=function(a){var b=js_cols.getCount(a);if(this.getCount()>b)return!1;b=0;if(this.isEmpty())return!0;if(js_cols.typeOf(a.get)=="function")for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))a.get.call(a,c.key)==c.value&&b++;else for(c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))js_cols.contains.call(a,a,c.key)&&b++;return b==this.getCount()};
js_cols.RedBlackMap.prototype.range=function(a,b){var c=[];this.traverseFromTo(function(a){c.push(a)},a,b);return c};js_cols.RedBlackMap.prototype.traverse=function(a){if(!this.isEmpty())for(var b=this.min(this.root);b!=this.sentinel;){if(a(b.value))break;b=this.successor_(b)}};js_cols.RedBlackMap.prototype.traverseFrom=function(a,b){if(!this.isEmpty())for(var c=this.get_(b);c!=this.sentinel;){if(a(c.value))break;c=this.successor_(c)}};
js_cols.RedBlackMap.prototype.traverseTo=function(a,b){if(!this.isEmpty())for(var c=this.min(this.root),d=this.get_(b);c!=d;){if(a(c.value))break;c=this.successor_(c)}};js_cols.RedBlackMap.prototype.traverseFromTo=function(a,b,c){if(!this.isEmpty()){b=this.get_(b);for(c=this.get_(c);b!=c;){if(a(b.value))break;b=this.successor_(b)}}};js_cols.RedBlackMap.prototype.traverseBackwards=function(a){if(!this.isEmpty())for(var b=this.max(this.root);b!=this.sentinel;){if(a(b.value))break;b=this.predecessor_(b)}};
js_cols.RedBlackMap.prototype.getCount=function(){return this.size};js_cols.RedBlackMap.prototype.isEmpty=function(){return this.size==0};js_cols.RedBlackSet=function(a){this.RED=!0;this.BLACK=!1;this.size=0;this.sentinel=new js_cols.RBnode(this);this.sentinel.color=this.BLACK;this.root=this.sentinel;this.root.parent=this.sentinel;this.compare=a||this.default_compare};js_cols.RedBlackSet.prototype.default_compare=function(a,b){return a<b?-1:b<a?1:0};
js_cols.RedBlackSet.prototype.clone=function(){var a=new js_cols.RedBlackSet(this.compare);a.insertAll(this);return a};js_cols.RedBlackSet.prototype.clear=function(){this.size=0;this.sentinel=new js_cols.RBnode(this);this.sentinel.color=this.BLACK;this.root=this.sentinel;this.root.parent=this.sentinel};
js_cols.RedBlackSet.prototype.leftRotate=function(a){var b=a.right;a.right=b.left;if(b.left!=this.sentinel)b.left.parent=a;b.parent=a.parent;a.parent==this.sentinel?this.root=b:a==a.parent.left?a.parent.left=b:a.parent.right=b;b.left=a;a.parent=b};js_cols.RedBlackSet.prototype.rightRotate=function(a){var b=a.left;a.left=b.right;if(b.right!=this.sentinel)b.right.parent=a;b.parent=a.parent;a.parent==this.sentinel?this.root=b:a==a.parent.right?a.parent.right=b:a.parent.left=b;b.right=a;a.parent=b};
js_cols.RedBlackSet.prototype.insert=function(a){if(this.contains(a))this.get_(a).key=a;else{var b=new js_cols.RBnode(this);b.key=a;for(var a=this.sentinel,c=this.root;c!=this.sentinel;)a=c,c=this.compare(b.key,c.key)<0?c.left:c.right;b.parent=a;a==this.sentinel?this.root=b:this.compare(b.key,a.key)<0?a.left=b:a.right=b;b.left=this.sentinel;b.right=this.sentinel;b.color=this.RED;this.insertFixup(b);this.size++}};
js_cols.RedBlackSet.prototype.insertFixup=function(a){for(;a!=this.sentinel&&a!=this.root&&a.parent.color==this.RED;)if(a.parent==a.parent.parent.left){var b=a.parent.parent.right;if(b.color==this.RED)a.parent.color=this.BLACK,b.color=this.BLACK,a.parent.parent.color=this.RED,a=a.parent.parent;else{if(a==a.parent.right)a=a.parent,this.leftRotate(a);a.parent.color=this.BLACK;a.parent.parent.color=this.RED;a.parent.parent!=this.sentinel&&this.rightRotate(a.parent.parent)}}else if(b=a.parent.parent.left,
b.color==this.RED)a.parent.color=this.BLACK,b.color=this.BLACK,a.parent.parent.color=this.RED,a=a.parent.parent;else{if(a==a.parent.left)a=a.parent,this.rightRotate(a);a.parent.color=this.BLACK;a.parent.parent.color=this.RED;a.parent.parent!=this.sentinel&&this.leftRotate(a.parent.parent)}this.root.color=this.BLACK};
js_cols.RedBlackSet.prototype.delete_=function(a){var b,c;b=a.left==this.sentinel||a.right==this.sentinel?a:this.successor_(a);c=b.left!=this.sentinel?b.left:b.right;c.parent=b.parent;b.parent==this.sentinel?this.root=c:b==b.parent.left?b.parent.left=c:b.parent.right=c;if(b!=a)a.key=b.key;b.color==this.BLACK&&this.deleteFixup(c);this.size--};
js_cols.RedBlackSet.prototype.deleteFixup=function(a){for(;a!=this.root&&a.color==this.BLACK;)if(a==a.parent.left){var b=a.parent.right;if(b.color==this.RED)b.color=this.BLACK,a.parent.color=this.RED,this.leftRotate(a.parent),b=a.parent.right;if(b.left.color==this.BLACK&&b.right.color==this.BLACK)b.color=this.RED,a=a.parent;else{if(b.right.color==this.BLACK)b.left.color=this.BLACK,b.color=this.RED,this.rightRotate(b),b=a.parent.right;b.color=a.parent.color;a.parent.color=this.BLACK;b.right.color=
this.BLACK;this.leftRotate(a.parent);a=this.root}}else{b=a.parent.left;if(b.color==this.RED)b.color=this.BLACK,a.parent.color=this.RED,this.rightRotate(a.parent),b=a.parent.left;if(b.right.color==this.BLACK&&b.left.color==this.BLACK)b.color=this.RED,a=a.parent;else{if(b.left.color==this.BLACK)b.right.color=this.BLACK,b.color=this.RED,this.leftRotate(b),b=a.parent.left;b.color=a.parent.color;a.parent.color=this.BLACK;b.left.color=this.BLACK;this.rightRotate(a.parent);a=this.root}}a.color=this.BLACK};
js_cols.RedBlackSet.prototype.remove=function(a){a=this.get_(a);if(a!=this.sentinel){var b=a.key;this.delete_(a);return b}else return null};js_cols.RedBlackSet.prototype.removeSwapped=function(a,b){this.remove(b)};js_cols.RedBlackSet.prototype.min=function(a){for(;a.left!=this.sentinel;)a=a.left;return a};js_cols.RedBlackSet.prototype.max=function(a){for(;a.right!=this.sentinel;)a=a.right;return a};
js_cols.RedBlackSet.prototype.successor_=function(a){if(a.right!=this.sentinel)return this.min(a.right);for(var b=a.parent;b!=this.sentinel&&a==b.right;)a=b,b=b.parent;return b};js_cols.RedBlackSet.prototype.predeccessor_=function(a){if(a.left!=this.sentinel)return this.max(a.left);for(var b=a.parent;b!=this.sentinel&&a==b.left;)a=b,b=b.parent;return b};
js_cols.RedBlackSet.prototype.successor=function(a){if(this.size>0){a=this.get_(a);if(a==this.sentinel)return null;if(a.right!=this.sentinel)return this.min(a.right).key;for(var b=a.parent;b!=this.sentinel&&a==b.right;)a=b,b=b.parent;return b!=this.sentinel?b.key:null}else return null};
js_cols.RedBlackSet.prototype.predecessor=function(a){if(this.size>0){a=this.get_(a);if(a==this.sentinel)return null;if(a.left!=this.sentinel)return this.max(a.left).key;for(var b=a.parent;b!=this.sentinel&&a==b.left;)a=b,b=b.parent;return b!=this.sentinel?b.key:null}else return null};js_cols.RedBlackSet.prototype.getMin=function(){return this.min(this.root).key};js_cols.RedBlackSet.prototype.getMax=function(){return this.max(this.root).key};
js_cols.RedBlackSet.prototype.get_=function(a){for(var b=this.root;b!=this.sentinel&&this.compare(b.key,a)!=0;)b=this.compare(a,b.key)<0?b.left:b.right;return b};js_cols.RedBlackSet.prototype.contains=function(a){return this.get_(a).key!=null};js_cols.RedBlackSet.prototype.getValues=function(){var a=[];this.forEach(function(b){a.push(b)});return a};
js_cols.RedBlackSet.prototype.insertAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.insert(a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.insert,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)this.insert(a[b])}else if(js_cols.typeOf(a)=="object")for(b in a)this.insert(a[b])};
js_cols.RedBlackSet.prototype.removeAll=function(a){if(js_cols.typeOf(a)=="array")for(var b=0;b<a.length;b++)this.remove(a[b]);else if(js_cols.typeOf(a.forEach)=="function")a.forEach(this.removeSwapped,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)this.remove(a[b])}else if(js_cols.typeOf(a)=="object")for(b in a)this.remove(a[b])};
js_cols.RedBlackSet.prototype.containsAll=function(a){if(js_cols.typeOf(a)=="array"){for(var b=0;b<a.length;b++)if(!this.contains(a[b]))return!1;return!0}else if(js_cols.typeOf(a.forEach)=="function")return a.every(this.contains,this);else if(js_cols.typeOf(a.getValues)=="function"){a=a.getValues();for(b=0;b<a.length;b++)if(!this.contains(a[b]))return!1;return!0}else if(js_cols.typeOf(a)=="object"){for(b in a)if(!this.contains(a[b]))return!1;return!0}};
js_cols.RedBlackSet.prototype.range=function(a,b){var c=[];this.traverseFromTo(function(a){c.push(a)},a,b);return c};js_cols.RedBlackSet.prototype.traverse=function(a,b){if(!this.isEmpty())for(var c=this.min(this.root);c!=this.sentinel;){if(a.call(b,c.key,this))break;c=this.successor_(c)}};js_cols.RedBlackSet.prototype.traverseFrom=function(a,b,c){if(!this.isEmpty())for(b=this.get_(b);b!=this.sentinel;){if(a.call(c,b.key,this))break;b=this.successor_(b)}};
js_cols.RedBlackSet.prototype.traverseTo=function(a,b,c){if(!this.isEmpty())for(var d=this.min(this.root),b=this.get_(b);d!=b;){if(a.call(c,d.key,this))break;d=this.successor_(d)}};js_cols.RedBlackSet.prototype.traverseFromTo=function(a,b,c,d){if(!this.isEmpty()){b=this.get_(b);for(c=this.get_(c);b!=c;){if(a.call(d,b.key,this))break;b=this.successor_(b)}}};
js_cols.RedBlackSet.prototype.traverseBackwards=function(a,b){if(!this.isEmpty())for(var c=this.max(this.root);c!=this.sentinel;){if(a.call(b,c.key,this))break;c=this.predeccessor_(c)}};js_cols.RedBlackSet.prototype.forEach=function(a,b){if(!this.isEmpty())for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))a.call(b,c.key,c.key,this)};
js_cols.RedBlackSet.prototype.some=function(a,b){if(this.isEmpty())return!1;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))if(a.call(b,c.key,c.key,this))return!0;return!1};js_cols.RedBlackSet.prototype.every=function(a,b){if(this.isEmpty())return!1;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))if(!a.call(b,c.key,c.key,this))return!1;return!0};
js_cols.RedBlackSet.prototype.map=function(a,b){var c=[];if(this.isEmpty())return c;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))c.push(a.call(b,d.key,d.key,this));return c};js_cols.RedBlackSet.prototype.filter=function(a,b){var c=[];if(this.isEmpty())return c;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))a.call(b,d.key,d.key,this)&&c.push(d.key);return c};js_cols.RedBlackSet.prototype.getCount=function(){return this.size};
js_cols.RedBlackSet.prototype.isEmpty=function(){return this.size==0};js_cols.RedBlackSet.prototype.isSubsetOf=function(a){var b=js_cols.getCount(a);if(this.getCount()>b)return!1;b=0;if(this.isEmpty())return!0;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))js_cols.contains.call(a,a,c.key)&&b++;return b==this.getCount()};
js_cols.RedBlackSet.prototype.intersection=function(a){var b=new js_cols.RedBlackSet(this.compare);if(this.isEmpty())return b;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))a.contains.call(a,c.key,c.key,this)&&b.insert(c.key);return b};js_cols.RedBlackBag=function(a){js_cols.RedBlackSet.call(this,a)};js_cols.inherits(js_cols.RedBlackBag,js_cols.RedBlackSet);
js_cols.RedBlackBag.prototype.insert=function(a){var b=new js_cols.RBnode(this);b.key=a;for(var a=this.sentinel,c=this.root;c!=this.sentinel;)a=c,c=this.compare(b.key,c.key)<0?c.left:c.right;b.parent=a;a==this.sentinel?this.root=b:this.compare(b.key,a.key)<0?a.left=b:a.right=b;b.left=this.sentinel;b.right=this.sentinel;b.color=this.RED;this.insertFixup(b);this.size++};
js_cols.RedBlackBag.prototype.get_=function(a){for(var b=this.root;b!=this.sentinel&&this.compare(b.key,a)!=0;)b=this.compare(a,b.key)<0?b.left:b.right;for(;b!=this.sentinel&&b.left!=this.sentinel&&this.compare(b.left.key,a)==0;)b=b.left;return b};js_cols.RedBlackBag.prototype.clone=function(){var a=new js_cols.RedBlackBag(this.compare);a.insertAll(this);return a};js_cols.RedBlackMultiMap=function(a){js_cols.RedBlackMap.call(this,a)};js_cols.inherits(js_cols.RedBlackMultiMap,js_cols.RedBlackMap);
js_cols.RedBlackMultiMap.prototype.insert=function(a,b){var c=new js_cols.RBnode(this);c.key=a;c.value=b;for(var d=this.sentinel,e=this.root;e!=this.sentinel;)d=e,e=this.compare(c.key,e.key)<0?e.left:e.right;c.parent=d;d==this.sentinel?this.root=c:this.compare(c.key,d.key)<0?d.left=c:d.right=c;c.left=this.sentinel;c.right=this.sentinel;c.color=this.RED;this.insertFixup(c);this.size++};
js_cols.RedBlackMultiMap.prototype.get_=function(a){for(var b=this.root;b!=this.sentinel&&this.compare(b.key,a)!=0;)b=this.compare(a,b.key)<0?b.left:b.right;for(;b!=this.sentinel&&b.left!=this.sentinel&&this.compare(b.left.key,a)==0;)b=b.left;return b};js_cols.RedBlackMultiMap.prototype.clone=function(){var a=new js_cols.RedBlackMultiMap(this.compare);a.insertAll(this);return a};js_cols.RedBlackMultiMap.prototype.isSubmapOf=void 0;js_cols.RedBlackMultiMap.prototype.intersection=void 0;