Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GeneratedSchedule

Hierarchy

Index

Constructors

constructor

Properties

All

All: ScheduleAll<Set<number>[]>

A generated schedule's All can never contain -1 (Any Section)

colorSlots

colorSlots: Set<string>[] = Array.from({ length: Schedule.colors.length }, () => new Set<string>())

keep track of used colors to avoid color collision

dateSelector

dateSelector: number = -1

the index of the currently selected separator (in dateSeparators)

dateSeparators

dateSeparators: number[] = []

The separator of sections in different time periods, representing different end times of sections. Elements are dates in milliseconds Example:

[1567457860885, 1567458860885]

days

days: ScheduleDays = [[], [], [], [], [], [], []]

computed based on this.All by computeSchedule

events

events: Event[]

totalCredit

totalCredit: number = 0

total credits stored in this schedule, computed based on this.All

Static colors

colors: readonly string[] = colorSchemes[0].colors

Static combineSections

combineSections: boolean = true

Static multiSelect

multiSelect: boolean = true

Static savedColors

savedColors: {}

Type declaration

  • [key: string]: string

Methods

Protected _copy

allEquals

cancelCompute

  • cancelCompute(): void

checkDate

clean

  • clean(): void

cleanSchedule

  • cleanSchedule(cleanDays?: boolean): void

computeSchedule

  • computeSchedule(sync?: boolean, time?: number): void
  • Compute the schedule view based on this.All and this.preview. If there is a pending compute task, remove that pending task.

    remarks

    this method has a very high time complexity. However, because we're running on small input sets (usually contain no more than 20 sections), it usually completes within 50ms.

    note

    it is the caller's responsibility to call constructDateSeparators, which is necessary if new classes are added

    Parameters

    • Default value sync: boolean = true

      if true, synchronously execute this function, otherwise use setTimeout

    • Default value time: number = 100

      the delay of setTimeout, in milliseconds

    Returns void

constructDateSeparator

  • constructDateSeparator(): void

constructDateSeparatorFromDateList

  • constructDateSeparatorFromDateList(dates: MeetingDate[]): void

copy

empty

  • empty(): boolean

equals

getSectionGroup

  • getSectionGroup(key: string, section: number): number

has

  • has(key: string, rendered?: boolean): boolean
  • Check whether the given key exists in the Schedule.

    Parameters

    • key: string
    • Default value rendered: boolean = true

      (default to true) if true, only returns true if the course/event with the given key is rendered

    Returns boolean

hasSection

  • hasSection(key: string, section: number): boolean

hover

  • hover(key: string, strong?: boolean): void

isAnySection

  • isAnySection(key: string): boolean

isCourseEmpty

  • isCourseEmpty(key: string): boolean

isGroup

  • isGroup(key: string): boolean

isSomeTBD

  • isSomeTBD(key: string): boolean

preview

remove

  • remove(): void

removePreview

  • removePreview(): void

toJSON

ungroup

  • ungroup(key: string): void

unhover

  • unhover(key: string): void

update

  • update(): void

Static compressJSON

Static decompressJSON

Object literals

current

current: object

a computed object that's updated by the computeSchedule method, used by ClassList for rendering purposes

  • courses contain all sections (not just those selected by user)
  • ids are the list of ids selected for a given course

courses

courses: never[] = []

ids

ids: never[] = []

Generated using TypeDoc