Accessors
size
- get size(): number
-
Returns number
Methods
delete
- delete(priority: number): boolean
-
Returns boolean
getInternalMap
- getInternalMap(): Record<number, T>
-
Returns Record<number, T>
getOrDefault
- getOrDefault(priority: number): undefined | T
-
Returns undefined | T
- getOrDefault(priority: number, orDefault: ((priority: number) => T), assign?: boolean): T
-
Parameters
-
priority: number
-
orDefault: ((priority: number) => T)
-
- (priority: number): T
-
Returns T
-
Optional
assign: boolean
Returns T
- getOrDefault(priority: number, orDefault?: ((priority: number) => T), assign?: boolean): undefined | T
-
Parameters
-
priority: number
-
Optional
orDefault: ((priority: number) => T)
-
- (priority: number): T
-
Returns T
-
Optional
assign: boolean
Returns undefined | T
retainWhere
- retainWhere(predicate: ((val: T, key: number) => any)): boolean
-
Parameters
-
predicate: ((val: T, key: number) => any)
-
- (val: T, key: number): any
-
Returns any
Returns boolean
- retainWhere(key: number, predicate: ((val: T, key: number) => any)): boolean
-
Parameters
-
key: number
-
predicate: ((val: T, key: number) => any)
-
- (val: T, key: number): any
-
Returns any
Returns boolean
stream
- stream(direction?: PriorityListStreamDirection): Stream<T>
-
Returns Stream<T>
Static
orderMultiple
- orderMultiple<T>(lists: PriorityMap<T>[]): T[]
-
Returns T[]
Used for ordering a list of items by "priority". Higher priorities come before lower priorities.