TimeInterval

TimeInterval

new

An interval defined by a start date and a stop date. The end points are optionally included in the interval. The interval should be treated as immutable.

Parameters:
Name Type Argument Default Description
start JulianDate The start date of the interval.
stop JulianDate The stop date of the interval.
isStartIncluded Boolean <optional>
true true if the start date is included in the interval, false otherwise.
isStopIncluded Boolean <optional>
true true if the stop date is included in the interval, false otherwise.
[data Object The data associated with this interval.
Throws:
Example
// Construct an Timeinterval closed on one end with a Color payload.
var interval = new TimeInterval(JulianDate.fromTotalDays(1000), JulianDate.fromTotalDays(1001), true, false, Color.WHITE);
See:
Source:

Members

The data associated with this interval.

Indicates if the interval is empty.

Indicates if start is included in the interval or not.

Indicates if stop is included in the interval or not.

The start time of the interval.

The stop time of the interval.

<static>

An empty interval.

Methods

Creates a copy of this TimeInterval.

Returns:
A new TimeInterval that is equal to this interval.

Returns true if this interval contains the specified date.

Parameters:
Name Type Description
date JulianDate The date to check for.
Returns:
Boolean true if the TimeInterval contains the specified date, false otherwise.

Compares this TimeInterval against the provided TimeInterval componentwise and returns true if they are equal, false otherwise.

Parameters:
Name Type Argument Description
right TimeInterval <optional>
The right hand side Cartesian.
Returns:
Boolean true if they are equal, false otherwise.

Compares this TimeInterval against the provided TimeInterval componentwise and returns true if they are within the provided epsilon, false otherwise.

Parameters:
Name Type Argument Description
right TimeInterval <optional>
The right hand side Cartesian.
epsilon Number The epsilon to use for equality testing.
Throws:
DeveloperError : epsilon is required and must be a number.
Returns:
Boolean true if they are within the provided epsilon, false otherwise.

<static>

Compares the provided TimeIntervals componentwise and returns true if they are equal, false otherwise.

Parameters:
Name Type Argument Description
left TimeInterval <optional>
The first Cartesian.
right TimeInterval <optional>
The second Cartesian.
Returns:
Boolean true if left and right are equal, false otherwise.

<static>

Compares the provided TimeIntervals componentwise and returns true if they are within the provided epsilon, false otherwise.

Parameters:
Name Type Argument Description
left TimeInterval <optional>
The first TimeInterval.
right TimeInterval <optional>
The second TimeInterval.
epsilon Number The epsilon to use for equality testing.
Throws:
DeveloperError : epsilon is required and must be number.
Returns:
Boolean true if left and right are within the provided epsilon, false otherwise.

<static>

Creates an immutable TimeInterval from an ISO 8601 interval string.

Parameters:
Name Type Argument Default Description
iso8601String String A valid ISO8601 interval.
isStartIncluded Boolean <optional>
true true if the start date is included in the interval, false otherwise.
isStopIncluded Boolean <optional>
true true if the stop date is included in the interval, false otherwise.
data Object <optional>
The data associated with this interval.
Returns:
TimeInterval The new TimeInterval instance or undefined if an invalid ISO8601 string is provided.
Example
// Construct an open Timeinterval with a Cartesian data payload.
var interval = TimeInterval.fromIso8601('2012-03-15T11:02:24.55Z/2012-03-15T12:28:24.03Z', false, false, new Cartesian3(1,2,3));
See:

<static>

Computes an interval which is the intersection of this interval with another while also providing a means to merge the data of the two intervals.

Parameters:
Name Type Argument Description
other TimeInterval The interval to intersect with this interval.
mergeCallback Function <optional>
A callback which takes the data property from both intervals as input and merges it into a single new value. If the callback is undefined, this will intersect the two intervals and return the new interval with the data from this interval.
Returns:
TimeInterval The new TimeInterval that is the intersection of the two intervals, with its data representing the merge of the data in the two existing intervals.