Class Collection<T, TCollection>
Type parameters
-
T
-
TCollection: Collection<T, TCollection>
Constructors
constructor
-
Properties
Private __values
__values: Array<T>
Private __valuesLock
__valuesLock: Object
Methods
add
-
Parameters
Returns boolean
addMany
- addMany(values: T[]): boolean
-
Parameters
Returns boolean
Protected addSuccess
- addSuccess(value: T): void
-
Parameters
Returns void
any
- any(predicate: IFunction1<T, boolean>): boolean
- any(): boolean
-
Parameters
-
predicate: IFunction1<T, boolean>
Returns boolean
-
Returns boolean
Protected Abstract arrayFromList
- arrayFromList(list: Array<T>): T[]
-
Parameters
Returns T[]
contains
- contains(value: T): boolean
-
Parameters
Returns boolean
Protected Abstract createCollection
- createCollection(): TCollection
-
Returns TCollection
first
- first(predicate: IFunction1<T, boolean>): T
- first(): T
-
Parameters
-
predicate: IFunction1<T, boolean>
Returns T
-
Returns T
firstOrDefault
- firstOrDefault(): T
- firstOrDefault(predicate: IFunction1<T, boolean>): T
-
Returns T
-
Parameters
-
predicate: IFunction1<T, boolean>
Returns T
forEach
- forEach(callback: IAction2<T, number>): void
-
Parameters
-
callback: IAction2<T, number>
Returns void
getCount
-
Returns number
getTypeString
-
Returns string
getValue
-
Returns T
getValues
-
Returns T[]
last
- last(predicate: IFunction1<T, boolean>): T
- last(): T
-
Parameters
-
predicate: IFunction1<T, boolean>
Returns T
-
Returns T
lastOrDefault
- lastOrDefault(predicate: IFunction1<T, boolean>): T
- lastOrDefault(): T
-
Parameters
-
predicate: IFunction1<T, boolean>
Returns T
-
Returns T
remove
- remove(value: T): boolean
-
Parameters
Returns boolean
removeAll
-
Returns void
removeFirst
- removeFirst(condition: IFunction1<T, boolean>): T
- removeFirst(): T
-
Parameters
-
condition: IFunction1<T, boolean>
Returns T
-
Returns T
removeLast
- removeLast(): T
- removeLast(condition: IFunction1<T, boolean>): T
-
Returns T
-
Parameters
-
condition: IFunction1<T, boolean>
Returns T
removeMany
- removeMany(values: T[]): boolean
-
Parameters
Returns boolean
Protected removeSuccess
- removeSuccess(value: T): void
-
Parameters
Returns void
replace
- replace(values: T[]): void
-
Parameters
Returns void
setValue
-
Parameters
Returns void
setValues
- setValues(value: T[]): void
-
Parameters
Returns void
single
- single(predicate: IFunction1<T, boolean>): T
- single(): T
-
Parameters
-
predicate: IFunction1<T, boolean>
Returns T
-
Returns T
singleOrDefault
- singleOrDefault(): T
- singleOrDefault(predicate: IFunction1<T, boolean>): T
-
Returns T
-
Parameters
-
predicate: IFunction1<T, boolean>
Returns T
valueAt
- valueAt(index: number): T
-
Parameters
Returns T
valueAtOrDefault
- valueAtOrDefault(index: number): T
-
Parameters
Returns T
where
- where(predicate: IFunction2<T, number, boolean>): TCollection
-
Parameters
-
predicate: IFunction2<T, number, boolean>
Returns TCollection