Interface to traverse element's of set containers. It is implemented by forward iterator - TreeIterator and backward Iterator - ReverseIterator
Members
boolean
# equals
Two iterators are considered to be equal if they point to the same node of the same container
void
# next
Replaces node reference with the reference of the next node in the container. Can be used for manual iteration over a range of key-value pairs.
Example
let m = new TreeMap();
... // add key-value pairs., using numbers as keys
let from = t.lowerBound(0);
let to = t.upperBound(50);
let it = from;
while (!it.equals(to)) {
console.log(it.key);
it.next();
}
void
# prev
Replaces node reference with the reference of the previous node in the container Can be used for manual reverse iteration over a range of key-value pairs.
Example
let m = new TreeMap();
... // add key-value pairs., using numbers as keys
let from = t.lowerBound(0);
let to = t.upperBound(50);
let it = to;
while (!it.equals(from)) {
it.prev();
console.log(it.key);
}