Class: ValueCollection

hyrrokkin_engine.ValueCollection()

Implement a collection of values. Call hyrrokkin_engine.ValueCollection.create_from_collections or hyrrokkin_engine.ValueCollection.create_source static methods to create an appropriate instance of this class.

Constructor

new ValueCollection()

Source:

Methods

close()

Close the collection, freeing up any resources.
Source:
Throws:
if the collection has already been closed
Type
hrrokkin_engine.ValueCollectionClosedError

(async) get(index) → {Promise.<*>}

Retrieve a value from the collection
Parameters:
Name Type Description
index int the index into the collection
Source:
Throws:
  • if the collection has been closed
    Type
    hrrokkin_engine.ValueCollectionClosedError
  • if the index is out of range
    Type
    hrrokkin_engine.IndexError
Returns:
a promise that resolves to the returned value
Type
Promise.<*>

size() → {int}

Get the size of this collection
Source:
Throws:
if the collection has been closed
Type
hrrokkin_engine.ValueCollectionClosedError
Returns:
the number of items in the collection
Type
int

(static) create_from_collections(source_collections, transform_fn) → {hyrrokkin_engine.ValueCollection}

Create a collection by concatenating one or more collections
Parameters:
Name Type Description
source_collections Array.<hyrrokkin_engine.ValueCollection> the collections to concatenate
transform_fn transformFunction | asyncTransformFunction an optional function to transform values from the source collections into this collection
Source:
Returns:
Type
hyrrokkin_engine.ValueCollection

(static) create_from_store(value_store) → {hyrrokkin_engine.ValueCollection}

Create a collection based on a value store
Parameters:
Name Type Description
value_store hyrrokkin_engine.ValueStore an object implementing the ValueStore interface which is used to store values held in the collection
Source:
Returns:
A new ValueCollection instance
Type
hyrrokkin_engine.ValueCollection