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: am4core.OrderedList */Inheritance
OrderedList does not extend any other symbol.
OrderedList is extended by SortedList, OrderedListTemplate.
Properties
eventsType
EventDispatcher<AMEvent<OrderedList<T>,ISortedListEvents<T>>>Defaultnew EventDispatcher()Event dispatcher.
firstType
T|undefinedFirst item in the list.
lastType
T|undefinedLast item in the list.
lengthType
numberNumber of items in the list.
valuesType
Array<T>All items of the list.
Do not modify the list directly. Rather use
insert()andremove()methods.
Methods
[Symbol.iterator]()Returns
Iterator<T>Returns an ES6 iterator for the list.
clear()Returns
voidRemoves all items from the list.
constructor(initial?:Array<T>)Returns
OrderedListConstructor
contains(value:T)Returns
booleanChecks if list contains the
value.each(f: (value:T, index:number) =>void)Returns
voidCalls
ffor each element in the list.getIndex(index:number)Returns
T|undefinedReturns an item at specific
index.indexOf(value:T)Returns
numberReturns the index of the specific
value.-1 if not found.
insert(value:T)Returns
voidInserts a value into list.
iterator()Returns
Iterator<T>Returns a list iterator.
remove(value:T)Returns
voidRemoves an item with the
valuefrom the list.setAll(newArray:Array<T>)Returns
voidSets multiple items to the list.
All current items are removed.
slice(start:number,
end:number)Returns
OrderedList<T>Returns part of the list between
startandendindexes, as a newOrderedList.
Events
2 inherited items
insertedParam { type:
"inserted", target:OrderedList, index:number, newValue:A}Inherited fromSortedListInvoked when new value is inserted into the list.
removedParam { type:
"removed", target:OrderedList, index:number, oldValue:A}Inherited fromSortedListInvoked when a value is removed from the list.