new TimeInterval(start, stop, isStartIncluded, isStopIncluded, [data)
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.
| Name | Type | Default | Description |
|---|---|---|---|
start |
JulianDate | The start date of the interval. | |
stop |
JulianDate | The stop date of the interval. | |
isStartIncluded |
Boolean |
true
|
optional
true if the start date is included in the interval, false otherwise. |
isStopIncluded |
Boolean |
true
|
optional
true if the stop date is included in the interval, false otherwise. |
[data |
Object | The data associated with this interval. |
Throws:
-
DeveloperError : start must be specified.
-
DeveloperError : stop must be specified.
Example:
// Construct an Timeinterval closed on one end with a Color payload.
var interval = new Cesium.TimeInterval(Cesium.JulianDate.fromTotalDays(1000), Cesium.JulianDate.fromTotalDays(1001), true, false, Cesium.Color.WHITE);
See:
Source:
Core/TimeInterval.js, line 40
Members
-
staticTimeInterval.EMPTY
-
An empty interval.Source: Core/TimeInterval.js, line 186
-
data
-
The data associated with this interval.Source: Core/TimeInterval.js, line 71
-
isEmpty
-
Indicates if the interval is empty.Source: Core/TimeInterval.js, line 83
-
isStartIncluded
-
Indicates if
startis included in the interval or not.Source: Core/TimeInterval.js, line 75 -
isStopIncluded
-
Indicates if
stopis included in the interval or not.Source: Core/TimeInterval.js, line 79 -
start
-
The start time of the interval.Source: Core/TimeInterval.js, line 63
-
stop
-
The stop time of the interval.Source: Core/TimeInterval.js, line 67
Methods
-
staticTimeInterval.equals(left, right, dataComparer) → Boolean
-
Compares the provided TimeIntervals and returns
trueif they are equal,falseotherwise.Name Type Description leftTimeInterval optional The first interval. rightTimeInterval optional The second interval. dataComparerfunction optional A function which compares the data of the two intervals. If ommitted, reference equality is used. Returns:
trueif left and right are equal,falseotherwise.Source: Core/TimeInterval.js, line 125 -
staticTimeInterval.equalsEpsilon(left, right, epsilon, dataComparer) → Boolean
-
Compares the provided TimeIntervals componentwise and returns
trueif they are within the provided epsilon,falseotherwise.Name Type Description leftTimeInterval optional The first TimeInterval. rightTimeInterval optional The second TimeInterval. epsilonNumber The epsilon to use for equality testing. dataComparerfunction optional A function which compares the data of the two intervals. If ommitted, reference equality is used. Returns:
trueif left and right are within the provided epsilon,falseotherwise.Source: Core/TimeInterval.js, line 151 -
staticTimeInterval.fromIso8601(iso8601String, isStartIncluded, isStopIncluded, data) → TimeInterval
-
Creates an immutable TimeInterval from an ISO 8601 interval string.
Name Type Default Description iso8601StringString A valid ISO8601 interval. isStartIncludedBoolean trueoptional trueif the start date is included in the interval,falseotherwise.isStopIncludedBoolean trueoptional trueif the stop date is included in the interval,falseotherwise.dataObject optional The data associated with this interval. Returns:
The newTimeIntervalinstance orundefinedif an invalid ISO8601 string is provided.Example:
// Construct an open Timeinterval with a Cartesian data payload. var interval = Cesium.TimeInterval.fromIso8601('2012-03-15T11:02:24.55Z/2012-03-15T12:28:24.03Z', false, false, new Cesium.Cartesian3(1,2,3));See:
Source: Core/TimeInterval.js, line 107 -
clone()
-
Creates a copy of this TimeInterval.
Returns:
A new TimeInterval that is equal to this interval.Source: Core/TimeInterval.js, line 177 -
contains(date) → Boolean
-
Returns
trueif this interval contains the specified date.Name Type Description dateJulianDate The date to check for. Returns:
trueif the TimeInterval contains the specified date,falseotherwise.Source: Core/TimeInterval.js, line 265 -
equals(right, dataComparer) → Boolean
-
Compares this TimeInterval against the provided TimeInterval componentwise and returns
trueif they are equal,falseotherwise.Name Type Description rightTimeInterval optional The right hand side Cartesian. dataComparerfunction optional A function which compares the data of the two intervals. If ommitted, reference equality is used. Returns:
trueif they are equal,falseotherwise.Source: Core/TimeInterval.js, line 296 -
equalsEpsilon(right, epsilon, dataComparer) → Boolean
-
Compares this TimeInterval against the provided TimeInterval componentwise and returns
trueif they are within the provided epsilon,falseotherwise.Name Type Description rightTimeInterval optional The right hand side Cartesian. epsilonNumber The epsilon to use for equality testing. dataComparerfunction optional A function which compares the data of the two intervals. If ommitted, reference equality is used. Returns:
trueif they are within the provided epsilon,falseotherwise.Source: Core/TimeInterval.js, line 312 -
intersect(other, mergeCallback) → TimeInterval
-
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.
Name Type Description otherTimeInterval The interval to intersect with this interval. mergeCallbackfunction 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:
The newTimeIntervalthat is the intersection of the two intervals, with its data representing the merge of the data in the two existing intervals.Source: Core/TimeInterval.js, line 201
