OrderedList

Type class

Ordered list contains values of any type in an indexed array.

Sources

OrderedList can be used (imported) via one of the following packages.

/**
 * --------------------------------------------------------
 * Import from: "core.ts"
 * Use like: am4core.OrderedList
 * --------------------------------------------------------
 */
import * as am4core from "@amcharts/amcharts4/core";

/**
 * --------------------------------------------------------
 * Include via: <script src="core.js"></script>
 * Access items like: am4.OrderedList
 * --------------------------------------------------------
 */

Inheritance

OrderedList does not extend any other symbol.

OrderedList is extended by SortedList, OrderedListTemplate.

Properties

events
#

Type EventDispatcher < AMEvent < OrderedList < T > , ISortedListEvents < T > > >

Default new EventDispatcher()

Event dispatcher.

first
#

Type T | undefined

First item in the list.

last
#

Type T | undefined

Last item in the list.

length
#

Type number

Number of items in the list.

@readonly

values
#

Type Array < T >

All items of the list.

Do not modify the list directly. Rather use insert() and remove() methods.

Methods

[Symbol.iterator]()

#

Returns Iterator < T >

Returns an ES6 iterator for the list.

clear()

#

Returns void

Removes all items from the list.

constructor(

initial?: Array < T >

)

#

Returns OrderedList

Constructor

contains(

value: T

)

#

Returns boolean

Checks if list contains the value.

each(

f: ( value: T, index: number) => void

)

#

Returns void

Calls f for each element in the list.

getIndex(

index: number

)

#

Returns T | undefined

Returns an item at specific index.

indexOf(

value: T

)

#

Returns number

Returns the index of the specific value.

-1 if not found.

insert(

value: T

)

#

Returns void

Inserts a value into list.

iterator()

#

Returns Iterator < T >

Returns a list iterator.

remove(

value: T

)

#

Returns void

Removes an item with the value from the list.

setAll(

newArray: Array < T >

)

#

Returns void

Sets multiple items to the list.

All current items are removed.

slice(

start: number,
end: number

)

#

Returns OrderedList < T >

Returns part of the list between start and end indexes, as a new OrderedList.

Events

#inserted

Param { index: number,
  newValue: A,
  type: "inserted",
  target: OrderedList }

Inherited from SortedList

Invoked when new value is inserted into the list.

#removed

Param { index: number,
  oldValue: A,
  type: "removed",
  target: OrderedList }

Inherited from SortedList

Invoked when a value is removed from the list.

There are 2 inherited items currently hidden from this list.

Adapters

OrderedList does not have any adapters.