documentationfor yFiles for HTML 2.6

IList<T>

A read-write list- or array-like collection of objects of the same type.

Inheritance Hierarchy
Implemented Interfaces

Remarks

This is a convertible type that can be used with the following notation(s) in parameter lists, parameter objects or setters when annotated as such:

It is possible to specify an Array or to use the native 'iterable' protocol, iterators, or generators to populate the IList<T> instance:

// Array
object.property = [item1, item2]

// Iterables
object.property = new Set([item1, item2])
object.property = new Map([
  [key1, item1],
  [key2, item2]
]).entries()

// Generators
function* generator(i) {
  yield i
  yield i + 10
}

// via the iterator protocol (with invocation)
object.property = generator(10)

// via the generator function (will be executed immediately to populate the collection)
object.property = function* generateValues() {
  yield 1
  yield 2
}// Array
object.property = [item1, item2]

// Iterables
object.property = new Set([item1, item2])
object.property = new Map([
  [key1, item1],
  [key2, item2]
]).entries()

// Generators
function* generator(i: number) {
  yield i
  yield i + 10
}

// via the iterator protocol (with invocation)
object.property = generator(10)

// via the generator function (will be executed immediately to populate the collection)
object.property = function* generateValues() {
  yield 1
  yield 2
}

Note that when using native iterables, in contrast to IEnumerable<T> created with from which will reevaluate upon re-enumeration, the list will be populated only once, immediately after creation when created with from, and thus the generator will only be executed once.

Type Parameters

T
The type of objects in the list.

Type Details

yfiles module
core
yfiles-umd modules
All modules
Legacy UMD name
yfiles.collections.IList

See Also

Properties

Methods

Static Methods