ItemList
The ItemList
class collects items and then arranges them into an array
by priority.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
items: {} The items in the list |
Method Summary
Public Methods | ||
public |
Add an item to the list. |
|
public |
Get the content of an item. |
|
public |
Check whether an item is present in the list. |
|
public |
Check whether the list is empty. |
|
public |
Merge another list's items into this one. |
|
public |
Remove an item from the list. |
|
public |
Replace an item in the list, only if it is already present. |
|
public |
toArray(): * Convert the list into an array of item content arranged by priority. |
Public Constructors
public constructor() source
Public Members
Public Methods
public add(key: undefined, content: undefined, priority: undefined): * source
Add an item to the list.
Return:
* |
public get(key: undefined): * source
Get the content of an item.
Params:
Name | Type | Attribute | Description |
key | undefined |
Return:
* |
public has(key: undefined): * source
Check whether an item is present in the list.
Params:
Name | Type | Attribute | Description |
key | undefined |
Return:
* |
public merge(items: undefined): * source
Merge another list's items into this one.
Params:
Name | Type | Attribute | Description |
items | undefined |
Return:
* |
public remove(key: undefined): * source
Remove an item from the list.
Params:
Name | Type | Attribute | Description |
key | undefined |
Return:
* |
public replace(key: undefined, content: undefined, priority: undefined): * source
Replace an item in the list, only if it is already present.
Return:
* |
public toArray(): * source
Convert the list into an array of item content arranged by priority. Each
item's content will be assigned an itemName
property equal to the item's
unique key.
Return:
* |