Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Grouping<TKey, T>

A grouping.

template

T Type of the items.

template

TKey Type of the key.

Type parameters

  • TKey

  • T

Hierarchy

Implements

Index

Constructors

constructor

Properties

IS_ENUMERABLE

IS_ENUMERABLE: symbol = IS_ENUMERABLE

Indicates that that instance is an enumerable (sequence).

Protected _current

_current: IteratorResult<T>

Stores the current iterator result.

Protected _index

_index: number = -1

Stores the current index.

Protected _key

_key: TKey

Stores the key.

Protected _sequence

_sequence: IEnumerable<T>

The wrapped sequence.

Accessors

canReset

  • get canReset(): boolean

current

  • get current(): IteratorResult<T>

index

  • get index(): number

key

  • get key(): TKey

Methods

__@iterator

  • __@iterator(): Iterator<T>

abs

aggregate

  • aggregate<TAccumulate, TResult>(func: function, seed?: TAccumulate, resultSelector?: function): TResult
  • inheritdoc

    Type parameters

    • TAccumulate

    • TResult

    Parameters

    • func: function
        • (accumulator: TAccumulate, item: T): TAccumulate
        • Parameters

          • accumulator: TAccumulate
          • item: T

          Returns TAccumulate

    • Optional seed: TAccumulate
    • Optional resultSelector: function
        • (accumulator: TAccumulate): TResult
        • Parameters

          • accumulator: TAccumulate

          Returns TResult

    Returns TResult

all

any

  • Checks if at least one element of that sequence satisfies a condition or not.

    Parameters

    Returns boolean

    One element satisfies the condition or not.

append

appendArray

arcCos

arcCosH

arcSin

arcSinH

arcTan

arcTanH

assert

assertAll

async

  • async(action: AsyncAction<T>, previousValue?: any): Promise<any>

average

  • average(selector?: Selector<T, number>): number | symbol

cast

  • Returns a "casted" version of that sequence.

    template

    U The target type.

    throws

    Target type is not supported

    Type parameters

    • U

    Parameters

    • Optional type: string

    Returns IEnumerable<U>

    The "casted" sequence.

ceil

chunk

Protected chunkInner

  • chunkInner(size: number): IterableIterator<IEnumerable<T>>

clone

Protected cloneInner

  • cloneInner<U>(count: number, itemSelector: Selector<T, U>): IterableIterator<any>

concat

concatArray

Protected concatArrayInner

  • concatArrayInner<U>(sequences: ArrayLike<Sequence<U>>): IterableIterator<T | U>

consume

  • consume(): this

contains

cos

cosH

count

defaultArrayIfEmpty

defaultIfEmpty

  • defaultIfEmpty(...defaultItems: Array<T>): IEnumerable<T>

Protected defaultIfEmptyInner

  • defaultIfEmptyInner(defaultItems: Array<T>): IterableIterator<T>

defaultSequenceIfEmpty

Protected defaultSequenceIfEmptyInner

  • defaultSequenceIfEmptyInner(defaultSequence: Sequence<T>): IterableIterator<T>

distinct

distinctBy

Protected distinctByInner

each

eachAll

elementAt

  • elementAt(index: number): T

elementAtOrDefault

  • elementAtOrDefault<U>(index: number, defaultValue?: U): T | U

except

Protected exceptInner

  • exceptInner(second: Array<T>, comparer: EqualityComparer<T>): IterableIterator<T>

exp

  • Handles current items as numbers and calculates e (the base of natural logarithms) raised to each value.

    Parameters

    • Optional handleAsInt: boolean

    Returns IEnumerable<number>

    The new sequence.

first

firstOrDefault

  • firstOrDefault<U>(predicateOrDefaultValue?: Predicate<T> | T, defaultValue?: U): T | U

flatten

floor

forAll

  • Invokes a function for each element of that sequence and continues even if an error is thrown. All occurred errors will be thrown at the end.

    throws

    At least on error was thrown while the execution.

    chainable

    Parameters

    Returns this

forEach

Protected getNextChunkArray

  • getNextChunkArray(size: number): T[]

groupBy

Protected groupByInner

groupJoin

  • groupJoin<TInner, TOuterKey, TInnerKey, TResult>(inner: Sequence<TInner>, outerKeySelector?: Selector<T, TOuterKey>, innerKeySelector?: Selector<TInner, TInnerKey>, resultSelector?: function, keyEqualityComparer?: EqualityComparer<TOuterKey, TInnerKey> | true): IEnumerable<TResult>

Protected groupJoinInner

  • groupJoinInner<TInner, TOuterKey, TInnerKey, TResult>(inner: IEnumerable<TInner>, outerKeySelector: Selector<T, TOuterKey>, innerKeySelector: Selector<TInner, TInnerKey>, resultSelector: function, keyEqualityComparer: EqualityComparer<TOuterKey, TInnerKey>): IterableIterator<TResult>

indexOf

  • Returns the zero based index of the first occurrence of an item.

    template

    U Type of the item to search for.

    Type parameters

    • U

    Parameters

    Returns number

    The index or -1 if not found.

intersect

Protected intersectInner

  • intersectInner(second: Array<T>, comparer: EqualityComparer<T>): IterableIterator<T>

intersperse

  • intersperse<U>(...separators: U[]): IEnumerable<T | U>

intersperseArray

Protected intersperseInner

  • intersperseInner<U>(separators: U[]): Iterator<T | U>

isEmpty

  • isEmpty(): boolean

join

  • join<TInner, TOuterKey, TInnerKey, TResult>(inner: Sequence<TInner>, outerKeySelector?: Selector<T, TOuterKey>, innerKeySelector?: Selector<TInner, TInnerKey>, resultSelector?: function, keyEqualityComparer?: EqualityComparer<TOuterKey, TInnerKey> | true): IEnumerable<TResult>
  • inheritdoc

    Type parameters

    • TInner

    • TOuterKey

    • TInnerKey

    • TResult

    Parameters

    • inner: Sequence<TInner>
    • Optional outerKeySelector: Selector<T, TOuterKey>
    • Optional innerKeySelector: Selector<TInner, TInnerKey>
    • Optional resultSelector: function
        • (outer: T, inner: TInner): TResult
        • Parameters

          • outer: T
          • inner: TInner

          Returns TResult

    • Optional keyEqualityComparer: EqualityComparer<TOuterKey, TInnerKey> | true

    Returns IEnumerable<TResult>

Protected joinInner

  • joinInner<TInner, TOuterKey, TInnerKey, TResult>(inner: IEnumerable<TInner>, outerKeySelector: Selector<T, TOuterKey>, innerKeySelector: Selector<TInner, TInnerKey>, resultSelector: function, keyEqualityComparer: EqualityComparer<TOuterKey, TInnerKey>): IterableIterator<TResult>
  • see

    join()

    Type parameters

    • TInner

    • TOuterKey

    • TInnerKey

    • TResult

    Parameters

    • inner: IEnumerable<TInner>
    • outerKeySelector: Selector<T, TOuterKey>
    • innerKeySelector: Selector<TInner, TInnerKey>
    • resultSelector: function
        • (outer: T, inner: TInner): TResult
        • Parameters

          • outer: T
          • inner: TInner

          Returns TResult

    • keyEqualityComparer: EqualityComparer<TOuterKey, TInnerKey>

    Returns IterableIterator<TResult>

joinToString

  • joinToString(separator?: any): string

last

lastIndexOf

lastOrDefault

  • lastOrDefault<U>(predicateOrDefaultValue?: Predicate<T> | T, defaultValue?: U): T | U

length

  • length(): number
  • Returns the length of the underlying collection. If the underlying object does NOT contain a 'length' property, like a generator, it will behave the same way as 'count' method.

    Returns number

    The length.

log

  • log(base?: number, handleAsInt?: boolean): IEnumerable<number>
  • Handles current items as numbers and calculates the logarithm of them.

    Parameters

    • Optional base: number
    • Optional handleAsInt: boolean

    Returns IEnumerable<number>

    The new sequence.

makeResettable

max

  • Returns the maximum item of that sequence.

    Type parameters

    • U

    Parameters

    Returns T | symbol

    The item or IS_EMPTY if that sequence is empty.

min

  • Returns the minimum item of that sequence.

    Type parameters

    • U

    Parameters

    Returns T | symbol

    The item or IS_EMPTY if that sequence is empty.

next

  • next(): IteratorResult<T>

noNAN

not

notEmpty

ofType

order

orderBy

orderByDescending

orderDescending

pipe

Protected pipeInner

pow

  • pow(exponent?: number, handleAsInt?: boolean): IEnumerable<number>
  • Handles current items as base numbers and take them to a specific power.

    Parameters

    • Optional exponent: number
    • Optional handleAsInt: boolean

    Returns IEnumerable<number>

    The new sequence.

prepend

prependArray

Protected prependArrayInner

  • prependArrayInner<U>(sequences: ArrayLike<Sequence<U>>): IterableIterator<T | U>

product

  • product(): T | symbol

pushTo

  • pushTo(stack: Stack<T>): this

rand

reset

  • reset(): this

reverse

root

  • root(power?: number, handleAsInt?: boolean): IEnumerable<number>
  • Handles current items as numbers and calculates the n-th root for each item.

    Parameters

    • Optional power: number
    • Optional handleAsInt: boolean

    Returns IEnumerable<number>

    The new sequence.

round

select

selectMany

Protected selectManyInner

sequenceEqual

shuffle

  • shuffle(sortValueProvider?: function): any

sin

sinH

single

  • Returns the one and only element of that sequence.

    throws

    Element not found or sequence contains for than one (matching) element.

    Parameters

    Returns T

    The single element.

singleOrDefault

  • singleOrDefault<U>(predicateOrDefaultValue?: Predicate<T> | T, defaultValue?: U): T | U
  • Tries to return the one and only element.

    template

    U Type of the default value.

    throws

    Sequence contains for than one (matching) element.

    Type parameters

    • U

    Parameters

    • Optional predicateOrDefaultValue: Predicate<T> | T
    • Optional defaultValue: U

    Returns T | U

    The item or the default value.

skip

skipLast

Protected skipLastInner

  • skipLastInner(): IterableIterator<T>

skipWhile

Protected skipWhileInner

  • skipWhileInner(predicate: Predicate<T>): IterableIterator<T>

sqrt

sum

  • sum(): T | symbol

take

takeWhile

Protected takeWhileInner

  • takeWhileInner(predicate: Predicate<T>): IterableIterator<T>

tan

tanH

toArray

  • toArray(): Array<T>

toLookup

toObject

  • toObject<TResult, TKey>(keySelector?: function): TResult
  • inheritdoc

    Type parameters

    • TResult

    • TKey: PropertyKey

    Parameters

    • Optional keySelector: function
        • (item: T, index: number): TKey
        • Parameters

          • item: T
          • index: number

          Returns TKey

    Returns TResult

trace

union

where

Protected whereInner

  • whereInner(predicate: Predicate<T>): IterableIterator<T>

zip

  • Applies a specified function to the corresponding elements of that sequence and another, producing a sequence of the results.

    template

    U Type of the other sequence.

    template

    TResult The result type.

    Type parameters

    • U

    • TResult

    Parameters

    Returns IEnumerable<TResult>

    The "zipped" sequence.

Protected zipInner

  • zipInner<U, TResult>(second: Iterator<U>, resultSelector: ZipSelector<T, U, TResult>): IterableIterator<TResult>

Generated using TypeDoc