Options
All
  • Public
  • Public/Protected
  • All
Menu

Class implements an interval applied by an event constraint. The interval suggests the only resolution option - removing the constraint.

Hierarchy

Index

Properties

descriptionBuilderClass

descriptionBuilderClass: typeof DateConstraintIntervalDescription

Class implementing the interval description builder.

endDate

endDate: Date

The start date of the interval. If end date is omitted it is set to MAX_DATE.

owner

The event applying the interval.

removeDateConstraintConflictResolutionClass

removeDateConstraintConflictResolutionClass: typeof RemoveDateConstraintConflictResolution

Class implementing "removing the constraint" resolution.

startDate

startDate: Date

The start date of the interval. If start date is omitted it is set to MIN_DATE.

Methods

containsDate

  • containsDate(date: Date, edgeInclusion?: EdgeInclusion): boolean
  • Test whether the given time point is within this interval. By default interval is considered to be inclusive on both sides.

    Parameters

    • date: Date
    • Default value edgeInclusion: EdgeInclusion = EdgeInclusion.Left

      deprecated parameter

    Returns boolean

endDateIsFinite

  • endDateIsFinite(): boolean
  • Indicates whether the interval end is specified

    Returns boolean

getDescription

  • getDescription(): string

getResolutions

  • Returns possible resolution options for cases when the interval takes part in a conflict.

    The interval suggests the only resolution option - removing the constraint.

    Parameters

    Returns ConflictResolution[]

initialize

  • initialize<T>(props?: Partial<T>): void
  • This method applies its 1st argument (if any) to the current instance using Object.assign().

    Supposed to be overridden in the subclasses to customize the instance creation process.

    Type parameters

    Parameters

    • Optional props: Partial<T>

    Returns void

intersect

  • Intersect this interval with another in the immutable way - returns a new interval.

    Parameters

    Returns DateInterval

intersectMut

  • Intersect this interval with another in the mutable way - updates current interval.

    Parameters

    • another: DateInterval
    • Default value collectIntersectionMeta: boolean = false

    Returns DateInterval

startDateIsFinite

  • startDateIsFinite(): boolean

Static new

  • new<T>(this: T, props?: Partial<InstanceType<T>>): InstanceType<T>
  • This is a type-safe static constructor method, accepting a single argument, with the object, corresponding to the class properties. It will generate a compilation error, if unknown property is provided.

    For example:

    class MyClass extends Base {
        prop     : string
    }
    
    const instance : MyClass = MyClass.new({ prop : 'prop', wrong : 11 })

    will produce:

    TS2345: Argument of type '{ prop: string; wrong: number; }' is not assignable to parameter of type 'Partial<MyClass>'.
    Object literal may only specify known properties, and 'wrong' does not exist in type 'Partial<MyClass>'

    The only thing this constructor does is create an instance and call the initialize method on it, forwarding the first argument. The customization of instance is supposed to be performed in that method.

    Type parameters

    Parameters

    • this: T
    • Optional props: Partial<InstanceType<T>>

    Returns InstanceType<T>

Generated using TypeDoc