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
start
is included in the interval or not.Source: Core/TimeInterval.js, line 75 -
isStopIncluded
-
Indicates if
stop
is 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
true
if they are equal,false
otherwise.Name Type Description left
TimeInterval optional The first interval. right
TimeInterval optional The second interval. dataComparer
function optional A function which compares the data of the two intervals. If ommitted, reference equality is used. Returns:
true
if left and right are equal,false
otherwise.Source: Core/TimeInterval.js, line 125 -
staticTimeInterval.equalsEpsilon(left, right, epsilon, dataComparer) → Boolean
-
Compares the provided TimeIntervals componentwise and returns
true
if they are within the provided epsilon,false
otherwise.Name Type Description left
TimeInterval optional The first TimeInterval. right
TimeInterval optional The second TimeInterval. epsilon
Number The epsilon to use for equality testing. dataComparer
function optional A function which compares the data of the two intervals. If ommitted, reference equality is used. Returns:
true
if left and right are within the provided epsilon,false
otherwise.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 iso8601String
String A valid ISO8601 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 optional The data associated with this interval. Returns:
The newTimeInterval
instance orundefined
if 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
true
if this interval contains the specified date.Name Type Description date
JulianDate The date to check for. Returns:
true
if the TimeInterval contains the specified date,false
otherwise.Source: Core/TimeInterval.js, line 265 -
equals(right, dataComparer) → Boolean
-
Compares this TimeInterval against the provided TimeInterval componentwise and returns
true
if they are equal,false
otherwise.Name Type Description right
TimeInterval optional The right hand side Cartesian. dataComparer
function optional A function which compares the data of the two intervals. If ommitted, reference equality is used. Returns:
true
if they are equal,false
otherwise.Source: Core/TimeInterval.js, line 296 -
equalsEpsilon(right, epsilon, dataComparer) → Boolean
-
Compares this TimeInterval against the provided TimeInterval componentwise and returns
true
if they are within the provided epsilon,false
otherwise.Name Type Description right
TimeInterval optional The right hand side Cartesian. epsilon
Number The epsilon to use for equality testing. dataComparer
function optional A function which compares the data of the two intervals. If ommitted, reference equality is used. Returns:
true
if they are within the provided epsilon,false
otherwise.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 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:
The newTimeInterval
that 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