Home Reference Source
import {KeyIterator} from 'rabbit-hole'
public class | source

KeyIterator

Implements:

  • Iterator
  • ,
  • Iterable

A key range iterator.

Constructor Summary

Public Constructor
public

constructor(keyDesign: KeyDesign, min: Vector3, max: Vector3)

Constructs a new key iterator.

Method Summary

Public Methods
public

Returns this iterator.

public

next(): IteratorResult

Iterates over the key range.

public

Resets this iterator.

public

return(value: Object): IteratorResult

Called when this iterator will no longer be run to completion.

Public Constructors

public constructor(keyDesign: KeyDesign, min: Vector3, max: Vector3) source

Constructs a new key iterator.

This iterator returns all keys in the specified coordinate range, including those at min and max.

Params:

NameTypeAttributeDescription
keyDesign KeyDesign

A key design.

min Vector3

The lower index bounds (zero-based unsigned integer coordinates).

max Vector3

The upper index bounds (zero-based unsigned integer coordinates).

Public Methods

public [Symbol.iterator](): KeyIterator source

Returns this iterator.

Return:

KeyIterator

An iterator.

public next(): IteratorResult source

Iterates over the key range.

Return:

IteratorResult

The next key.

public reset(): KeyIterator source

Resets this iterator.

Return:

KeyIterator

This iterator.

public return(value: Object): IteratorResult source

Called when this iterator will no longer be run to completion.

Params:

NameTypeAttributeDescription
value Object

An interator result value.

Return:

IteratorResult

A premature completion result.