Options
All
  • Public
  • Public/Protected
  • All
Menu

The base implementation of a mutable activity. An activity is considered mutable if it implements the MutableActivity interface. By doing so we now have access to various setter methods to alter the state of the activity.

since

1.0

Type parameters

  • T

    the type of the optional user object

Hierarchy

Implements

Index

Constructors

constructor

  • new MutableActivityBase(name: string, startTime: number, endTime: number): MutableActivityBase
  • Constructs a new mutable activity with the given name, start time, and end time.

    since

    1.0

    Parameters

    • name: string

      the name of the activity

    • startTime: number

      the start time of the activity

    • endTime: number

      the end time of the activity

    Returns MutableActivityBase

Properties

Static DEFAULT_DURATION

DEFAULT_DURATION: number = TimeUtil.ofDays(5)

Methods

addDuration

  • addDuration(duration: number, multiplier?: number): void
  • Convenience method to determine a new end time based on a duration that will be added several times to the current end time of the activity.

    since

    1.0

    Parameters

    • duration: number

      the duration of the activity

    • Default value multiplier: number = 1

      the number of times that the duration will be added

    Returns void

getDuration

  • getDuration(): number
  • Convenience method to determine the duration between the start and the end time of the activity.

    Returns number

    the duration of the activity

getEndTime

  • getEndTime(): number

getId

  • getId(): string
  • The unique id of the activity.

    since

    1.0

    Returns string

    the unique activity ID

getName

  • getName(): string
  • The name of the activity, for example "Flight 3441".

    since

    1.0

    Returns string

    the name of the activity

getStartTime

  • getStartTime(): number

getUserObject

  • getUserObject(): T
  • Returns the user object associated to the activity.

    since

    1.0

    Returns T

    the user object associated to the activity

setDuration

  • setDuration(duration: number): void
  • Convenience method to determine a new end time based on a duration that will be added to the current start time of the activity.

    since

    1.0

    Parameters

    • duration: number

      the duration of the activity

    Returns void

setEndTime

  • setEndTime(time: number): void
  • Sets a new end time on the activity.

    since

    1.0

    Parameters

    • time: number

      the new end time

    Returns void

setName

  • setName(name: string): void
  • Sets the name of the activity.

    since

    1.0

    Parameters

    • name: string

      the new name of the activity

    Returns void

setStartTime

  • setStartTime(time: number): void
  • Sets a new start time on the activity.

    since

    1.0

    Parameters

    • time: number

      the new start time

    Returns void

setUserObject

  • setUserObject(obj: T): void
  • Set the user object associated to the activity.

    since

    1.0

    Parameters

    • obj: T

      the user object to associate to the activity

    Returns void

toString

  • toString(): string
  • Returns string