ActivityOps

Operations mixin for timelines of activities.

Inheritors

Functions

Link copied to clipboard
open fun accumulatedDuration(unit: Duration): Real

(DOC) Creates a Real profile corresponding to the running total of time that this timeline has had an active object.

Link copied to clipboard
open fun active(): Booleans

(DOC) Returns a Booleans profile that is true when this timeline has an active object.

Link copied to clipboard
open fun cache(): THIS

(DOC) Caches the timeline for all available time.

abstract fun cache(opts: CollectOptions): THIS

Caches the result of collecting this timeline, to be reused for future collect requests if possible.

open fun cache(bounds: Interval): THIS

(DOC) A simplified version of cache.

Link copied to clipboard
open fun collect(): List<A>

(DOC) Collects the timeline for all available time.

abstract fun collect(opts: CollectOptions): List<A>

(DOC) Evaluates the stack of operations and produces a list of timeline payload objects.

open fun collect(bounds: Interval): List<A>

(DOC) A simplified version of collect.

Link copied to clipboard
open fun <U : IntervalLike<U>> connectTo(other: ParallelOps<U, *>, connectToBounds: Boolean): Universal<Connection<A, U>>

(DOC) Creates an Universal object of Connections that associate of this timeline's object to the (chronologically) next object in another timeline that starts after this one ends.

Link copied to clipboard
open fun <RESULT : GeneralOps<A, RESULT>> convert(ctor: (Timeline<A, RESULT>) -> RESULT): RESULT

(DOC) Safely converts to another timeline type that accepts the same payload type.

Link copied to clipboard
open fun countActive(): Numbers<Int>

(DOC) Returns a Numbers profile that corresponds to the number of active objects at any given time.

Link copied to clipboard
open fun ends(): THIS

(DOC) Truncates each object to only its end time.

Link copied to clipboard
open fun filter(preserveMargin: Boolean = false, f: (A) -> Boolean): THIS

(DOC) Removes or retains objects based on a predicate.

Link copied to clipboard
open fun filterByDuration(validInterval: Interval): THIS

(DOC) Removes objects whose duration is outside a given valid interval.

Link copied to clipboard
open fun filterByType(vararg types: String): THIS

Filters out all activities except those of a given vararg list of types.

open fun filterByType(types: List<String>): THIS

Filters out all activities except those of a given list of types.

Link copied to clipboard
open fun filterByWindows(windows: SerialOps<Interval, *>, truncateMarginal: Boolean = true): THIS

(DOC) Filters out payload objects whose intervals are not contained in the given Windows timeline.

Link copied to clipboard
open fun filterLongerThan(dur: Duration): THIS

(DOC) Removes objects whose duration is shorter than a given duration.

Link copied to clipboard
open fun filterShorterThan(dur: Duration): THIS

(DOC) Removes objects whose duration is longer than a given duration.

Link copied to clipboard

(DOC) Converts the payload objects into segments and flattens them into a serial profile.

Link copied to clipboard
open fun forEach(p0: Consumer<in A>)
Link copied to clipboard
open fun highlight(f: (A) -> Boolean): Windows

(DOC) Similar to filter, but produces a coalesced Windows object that highlights everything that satisfies the predicate.

Link copied to clipboard
open fun highlightAll(): Windows

(DOC) Highlights all objects in the timeline in a new Windows timeline.

Link copied to clipboard
open fun inspect(f: Consumer<List<A>>): THIS

(DOC) Inserts a no-op function into the operation stack to allow side effects, such as printing.

Link copied to clipboard
open fun isolate(f: (A) -> Boolean): Universal<A>

(DOC) Similar to filter, but returns an Universal timeline.

Link copied to clipboard
abstract operator fun iterator(): Iterator<A>
Link copied to clipboard
open infix fun merge(i: A): THIS

(DOC) Combines this timeline with a single payload object by overlaying them.

open infix fun merge(other: GeneralOps<A, *>): THIS

(DOC) Combines two timelines together by overlaying them. Does not perform any transformation.

Link copied to clipboard

(DOC) Converts the payload objects into segments and combines them into a serial profile.

Link copied to clipboard
open fun rollingDuration(range: Duration, unit: Duration): Real

(DOC) Calculates the sum of durations of objects in a range leading the current time.

Link copied to clipboard
open fun select(interval: Interval): THIS

(DOC) Restricts the timeline to only be evaluated in the given interval.

Link copied to clipboard
open fun shift(dur: Duration): THIS

(DOC) Uniformly shifts the entire timeline in time (positive shifts toward the future).

Link copied to clipboard
open fun shiftEndpoints(shiftStart: Duration, shiftEnd: Duration = shiftStart): THIS

(DOC) Shifts the start and end points of each object.

Link copied to clipboard
Link copied to clipboard
open fun starts(): THIS

(DOC) Truncates each object to only its start time.

Link copied to clipboard
abstract fun <RESULT : Timeline<A, RESULT>> unsafeCast(ctor: (Timeline<A, RESULT>) -> RESULT): RESULT

(DOC) UNSAFE! Casts this timeline type to another type without changing its contents.

Link copied to clipboard
open fun <R : IntervalLike<R>, RESULT : GeneralOps<R, RESULT>> unsafeFlatMap(ctor: (Timeline<R, RESULT>) -> RESULT, boundsTransformer: BoundsTransformer, truncate: Boolean, f: (A) -> Segment<GeneralOps<R, *>>): RESULT

(DOC) UNSAFE! Maps each object to a nested timeline and flattens all the timelines into one.

Link copied to clipboard
open fun unsafeMap(boundsTransformer: BoundsTransformer, truncate: Boolean, f: (A) -> A): THIS

(DOC) UNSAFE! A simpler version of unsafeMap for operations that don't change the timeline type.

open fun <R : IntervalLike<R>, RESULT : GeneralOps<R, RESULT>> unsafeMap(ctor: (Timeline<R, RESULT>) -> RESULT, boundsTransformer: BoundsTransformer, truncate: Boolean, f: (A) -> R): RESULT

(DOC) UNSAFE! Maps each timeline object to another object, of potentially a different type, at potentially a different time.

Link copied to clipboard
open fun <W : IntervalLike<W>, R : IntervalLike<R>, RESULT : GeneralOps<R, RESULT>> unsafeMap2(ctor: (Timeline<R, RESULT>) -> RESULT, other: GeneralOps<W, *>, op: (A, W, Interval) -> R?): RESULT

Performs a generalized binary operation between this and another timeline.

Link copied to clipboard
open fun unsafeMapIntervals(boundsTransformer: BoundsTransformer, truncate: Boolean, f: (A) -> Interval): THIS

(DOC) UNSAFE! Maps the interval of each object, leaving the rest of the object unchanged.

Link copied to clipboard
open fun unsafeOperate(f: Timeline<A, THIS>.(opts: CollectOptions) -> List<A>): THIS

(DOC) UNSAFE! A simpler version of unsafeOperate for operations that don't change the timeline type.

(DOC) UNSAFE! The basic, most general operation method. All operations eventually delegate here.

Link copied to clipboard
open fun unset(reject: Interval): THIS

(DOC) Unsets everything in a given interval. Timeline objects whose intervals fully contain the rejected interval may be split into two objects.