Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SectionList

An object which manages a collection of variable sized sections. The namespace for the SectionList class statics.

Notes

This class is an implementation detail. It is designed to manage the variable row and column sizes for a data grid. User code will not interact with this class directly.

Hierarchy

  • SectionList

Index

Constructors

constructor

Properties

Private _count

_count: number = 0

Private _defaultSize

_defaultSize: number

Private _length

_length: number = 0

Private _minimumSize

_minimumSize: number

Private _sections

_sections: Private.Section[] = []

Accessors

count

  • get count(): number

defaultSize

  • get defaultSize(): number
  • set defaultSize(value: number): void

length

  • get length(): number

minimumSize

  • get minimumSize(): number
  • set minimumSize(value: number): void

Methods

clampSize

  • clampSize(size: number): number
  • Clamp a size to the minimum section size

    Parameters

    • size: number

      The size to clamp.

    Returns number

    The size or the section minimum size, whichever is larger

clear

  • clear(): void

extentOf

  • extentOf(index: number): number
  • Find the extent of the section at the given index.

    Parameters

    • index: number

      The index of the section of interest.

    Returns number

    The extent of the section at the given index, or -1 if the index is out of range.

    Undefined Behavior

    An index which is non-integral.

    Complexity

    Logarithmic on the number of resized sections.

indexOf

  • indexOf(offset: number): number
  • Find the index of the section which covers the given offset.

    Parameters

    • offset: number

      The offset of the section of interest.

    Returns number

    The index of the section which covers the given offset, or -1 if the offset is out of range.

    Complexity

    Logarithmic on the number of resized sections.

insert

  • insert(index: number, count: number): void
  • Insert sections into the list.

    Parameters

    • index: number

      The index at which to insert the sections. This value will be clamped to the bounds of the list.

    • count: number

      The number of sections to insert. This method is a no-op if this value is <= 0.

      Undefined Behavior

      An index or count which is non-integral.

      Complexity

      Linear on the number of resized sections.

    Returns void

move

  • move(index: number, count: number, destination: number): void
  • Move sections within the list.

    Parameters

    • index: number

      The index of the first section to move. This method is a no-op if this value is out of range.

    • count: number

      The number of sections to move. This method is a no-op if this value is <= 0.

    • destination: number

      The destination index for the first section. This value will be clamped to the allowable range.

      Undefined Behavior

      An index, count, or destination which is non-integral.

      Complexity

      Linear on the number of moved resized sections.

    Returns void

offsetOf

  • offsetOf(index: number): number
  • Find the offset of the section at the given index.

    Parameters

    • index: number

      The index of the section of interest.

    Returns number

    The offset of the section at the given index, or -1 if the index is out of range.

    Undefined Behavior

    An index which is non-integral.

    Complexity

    Logarithmic on the number of resized sections.

remove

  • remove(index: number, count: number): void
  • Remove sections from the list.

    Parameters

    • index: number

      The index of the first section to remove. This method is a no-op if this value is out of range.

    • count: number

      The number of sections to remove. This method is a no-op if this value is <= 0.

      Undefined Behavior

      An index or count which is non-integral.

      Complexity

      Linear on the number of resized sections.

    Returns void

reset

  • reset(): void

resize

  • resize(index: number, size: number): void
  • Resize a section in the list.

    Parameters

    • index: number

      The index of the section to resize. This method is a no-op if this value is out of range.

    • size: number

      The new size of the section. This value will be clamped to an integer >= 0.

      Undefined Behavior

      An index which is non-integral.

      Complexity

      Linear on the number of resized sections.

    Returns void

sizeOf

  • sizeOf(index: number): number
  • Find the size of the section at the given index.

    Parameters

    • index: number

      The index of the section of interest.

    Returns number

    The size of the section at the given index, or -1 if the index is out of range.

    Undefined Behavior

    An index which is non-integral.

    Complexity

    Logarithmic on the number of resized sections.

Generated using TypeDoc