Comparing version 0.4.5 to 0.4.6
{ | ||
"name": "jjjrmi", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "util", |
@@ -18,3 +18,4 @@ /* global Symbol */ | ||
if (typeof c === "number") throw new Error("unsupported java to js operation"); | ||
for (let e of c) this.add(e); | ||
for (let e of c) | ||
this.add(e); | ||
} | ||
@@ -25,3 +26,3 @@ isEmpty() { | ||
removeAll(c) { | ||
for (let e of c){ | ||
for (let e of c) { | ||
this.remove(e); | ||
@@ -32,3 +33,3 @@ } | ||
let newElementData = []; | ||
for (let e of c){ | ||
for (let e of c) { | ||
if (this.contains(e)) newElementData.add(e); | ||
@@ -57,3 +58,4 @@ } | ||
toArray(a = []) { | ||
for (let i = 0; i < this.elementData.length; i++) a[i] = this.elementData[i]; | ||
for (let i = 0; i < this.elementData.length; i++) | ||
a[i] = this.elementData[i]; | ||
return a; | ||
@@ -95,15 +97,20 @@ } | ||
} | ||
remove(index) { | ||
remove(o) { | ||
if (typeof o === "number") return this.removeIndex(o); | ||
let index = this.indexOf(o); | ||
if (index === -1) return undefined; | ||
let r = this.elementData.splice(index, 1); | ||
return r[0]; | ||
} | ||
remove(o) { | ||
let r = this.elementData.splice(this.indexOf(o), 1); | ||
return r[0]; | ||
} | ||
removeRange(fromIndex, toIndex) { | ||
this.elementData.splice(fromIndex, toIndex - fromIndex); | ||
} | ||
removeIndex (index) { | ||
if (this.size >= index) throw new Error(`index '${index}' out of range`); | ||
if (this.size < 0) throw new Error(`index '${index}' out of range`); | ||
let r = this.elementData.splice(index, 1); | ||
return r[0]; | ||
} | ||
}; | ||
module.exports = ArrayList; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41927
1189