Abstract
Readonly
iteratorReadonly
Abstract
containerThe container pointed to by the iterator.
Whether this equals to obj.
container.find(1).equals(container.end());
The other iterator you want to compare.
Abstract
copyGet a copy of itself.
The copy of self.
const iter = container.find(1); // container = [1, 2]
const next = iter.copy().next();
console.log(next === iter); // false
console.log(next.equals(iter)); // false
console.log(next.pointer, iter.pointer); // 2, 1
Move this
iterator to pre.
The iterator's self.
const iter = container.find(1); // container = [0, 1]
const pre = iter.pre();
console.log(pre === iter); // true
console.log(pre.equals(iter)); // true
console.log(pre.pointer, iter.pointer); // 0, 0
Move this
iterator to next.
The iterator's self.
const iter = container.find(1); // container = [1, 2]
const next = iter.next();
console.log(next === iter); // true
console.log(next.equals(iter)); // true
console.log(next.pointer, iter.pointer); // 2, 2
Abstract
pointerPointers to element.
The value of the pointer's element.
const val = container.begin().pointer;
Set pointer's value (some containers are unavailable).
(<LinkList<number>>container).begin().pointer = 1;
The new value you want to set.
Get the sequential index of the iterator in the tree container.
Note:
This function only takes effect when the specified tree container enableIndex = true
.
The index subscript of the node in the tree.
const st = new OrderedSet([1, 2, 3], true);
console.log(st.begin().next().index); // 1
Generated using TypeDoc
Description
Iterator's type.
Example