Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SortOrder

defines a sort order of fields.

Caution, member fields eventually are shared by multiple instances! You may mutate member fields, but not the objects and arrays referenced by them.

Hierarchy

  • SortOrder

Hierarchy-Diagram

Index

Constructors

Properties

Methods

Constructors

constructor

  • default/copy constructor.

    Parameters

    • Optional other: SortOrder

      instance to optionally initialize an independent copy of.

    Returns SortOrder

Properties

sortFields

sortFields: SortField[]

ordered list of fields to sort on.

Methods

fromJSON

  • parses a JSON literal such as ['-rating', '+date', 'id'] into this instance.

    Parameters

    • json: string[]

      data, such as ['-rating', '+date'].

    Returns SortOrder

    this instance.

merge

  • combines an other instance such that this order is maintained by priority and equivalent elements are ordered by the other order.

    You may want to optimize after merging several instances.

    Parameters

    • other: SortOrder

      order to merge into this as secondary.

    Returns void

optimize

  • optimize(): void
  • eliminates redundant sort fields that do not affect overall order.

    Returns void

toString

  • toString(): string
  • formats a string such as '+name,-id'.

    Returns string

    representation of SortOrder, may be the empty string when this is empty.

Generated using TypeDoc