Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OrderedEnumerable<T, U>

An ordered sequence.

template

T Type of the items.

template

U Type of the sort keys.

Type parameters

  • T

  • U

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 _orderComparer

_orderComparer: Comparer<U, U>

Stores the comparer for the sort keys.

Protected _orderSelector

_orderSelector: Selector<T, U>

Stores the selector for the keys.

Protected _originalItems

_originalItems: Array<T>

Stores the items in the original order.

Protected _sequence

_sequence: IEnumerable<T>

The wrapped sequence.

Accessors

canReset

  • get canReset(): boolean

comparer

current

  • get current(): IteratorResult<T>

index

  • get index(): number

selector

  • get selector(): function
  • Gets the selector.

    Returns function

      • (x: T): any
      • Parameters

        • x: T

        Returns any

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

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

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

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

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>

makeResettable

max

min

next

  • next(): IteratorResult<T>

noNAN

not

notEmpty

ofType

order

orderBy

orderByDescending

orderDescending

pipe

Protected pipeInner

pow

  • pow(exponent?: number, handleAsInt?: boolean): IEnumerable<number>

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>

round

select

selectMany

Protected selectManyInner

sequenceEqual

shuffle

  • shuffle(sortValueProvider?: function): any

sin

sinH

single

singleOrDefault

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

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

then

thenBy

thenByDescending

thenDescending

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