Interface

SetIterator

SetIterator

Interface to traverse element's of set containers. It is implemented by forward iterator - TreeIterator and backward Iterator - ReverseIterator

View Source iterators.ts, line 262

Members

boolean

# equals

Two iterators are considered to be equal if they point to the same node of the same container

View Source iterators.ts, line 270

K

# key

Key of current node

View Source iterators.ts, line 283

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.

View Source iterators.ts, line 294

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.

View Source iterators.ts, line 310

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);
}