A non-overlapping collection of
TimeInterval
instances sorted by start time.
参数名称 | 类型 | 描述信息 |
---|---|---|
intervals |
Array.<TimeInterval> | 可选 An array of intervals to add to the collection. |
成员(属性)
readonly changedEvent : Event
Gets an event that is raised whenever the collection of intervals change.
Gets whether or not the collection is empty.
Gets whether or not the start time is included in the collection.
Gets whether or not the stop time is included in the collection.
Gets the number of intervals in the collection.
readonly start : JulianDate
Gets the start time of the collection.
readonly stop : JulianDate
Gets the stop time of the collection.
方法
static Cesium.TimeIntervalCollection.fromIso8601(options, result) → TimeIntervalCollection
Creates a new instance from an ISO 8601 time interval (start/end/duration).
参数名称 | 类型 | 描述信息 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
||||||||||||||||||||||||||||
result |
TimeIntervalCollection | 可选 An existing instance to use for the result. |
返回值:
The modified result parameter or a new instance if none was provided.
static Cesium.TimeIntervalCollection.fromIso8601DateArray(options, result) → TimeIntervalCollection
Creates a new instance from a ISO 8601 date array.
参数名称 | 类型 | 描述信息 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
||||||||||||||||||||||||||||
result |
TimeIntervalCollection | 可选 An existing instance to use for the result. |
返回值:
The modified result parameter or a new instance if none was provided.
static Cesium.TimeIntervalCollection.fromIso8601DurationArray(options, result) → TimeIntervalCollection
Creates a new instance from a ISO 8601 duration array.
参数名称 | 类型 | 描述信息 | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
||||||||||||||||||||||||||||||||||||
result |
TimeIntervalCollection | 可选 An existing instance to use for the result. |
返回值:
The modified result parameter or a new instance if none was provided.
static Cesium.TimeIntervalCollection.fromJulianDateArray(options, result) → TimeIntervalCollection
Creates a new instance from a JulianDate array.
参数名称 | 类型 | 描述信息 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
||||||||||||||||||||||||||||
result |
TimeIntervalCollection | 可选 An existing instance to use for the result. |
返回值:
The modified result parameter or a new instance if none was provided.
Adds an interval to the collection, merging intervals that contain the same data and
splitting intervals of different data as needed in order to maintain a non-overlapping collection.
The data in the new interval takes precedence over any existing intervals in the collection.
参数名称 | 类型 | 描述信息 |
---|---|---|
interval |
TimeInterval | The interval to add. |
dataComparer |
TimeInterval.DataComparer | 可选 A function which compares the data of the two intervals. If omitted, reference equality is used. |
Checks if the specified date is inside this collection.
参数名称 | 类型 | 描述信息 |
---|---|---|
julianDate |
JulianDate | The date to check. |
返回值:
true
if the collection contains the specified date, false
otherwise.
Compares this instance against the provided instance componentwise and returns
true
if they are equal, false
otherwise.
参数名称 | 类型 | 描述信息 |
---|---|---|
right |
TimeIntervalCollection | 可选 The right hand side collection. |
dataComparer |
TimeInterval.DataComparer | 可选 A function which compares the data of the two intervals. If omitted, reference equality is used. |
返回值:
true
if they are equal, false
otherwise.
Finds and returns the data for the interval that contains the specified date.
参数名称 | 类型 | 描述信息 |
---|---|---|
date |
JulianDate | The date to search for. |
返回值:
The data for the interval containing the specified date, or
undefined
if no such interval exists.
findInterval(options) → TimeInterval|undefined
Returns the first interval in the collection that matches the specified parameters.
All parameters are optional and
undefined
parameters are treated as a don't care condition.
参数名称 | 类型 | 描述信息 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
可选
Object with the following properties:
|
返回值:
The first interval in the collection that matches the specified parameters.
findIntervalContainingDate(date) → TimeInterval|undefined
Finds and returns the interval that contains the specified date.
参数名称 | 类型 | 描述信息 |
---|---|---|
date |
JulianDate | The date to search for. |
返回值:
The interval containing the specified date,
undefined
if no such interval exists.
get(index) → TimeInterval|undefined
Gets the interval at the specified index.
参数名称 | 类型 | 描述信息 |
---|---|---|
index |
number | The index of the interval to retrieve. |
返回值:
The interval at the specified index, or
undefined
if no interval exists as that index.
Finds and returns the index of the interval in the collection that contains the specified date.
参数名称 | 类型 | 描述信息 |
---|---|---|
date |
JulianDate | The date to search for. |
返回值:
The index of the interval that contains the specified date, if no such interval exists,
it returns a negative number which is the bitwise complement of the index of the next interval that
starts after the date, or if no interval starts after the specified date, the bitwise complement of
the length of the collection.
intersect(other, dataComparer, mergeCallback) → TimeIntervalCollection
Creates a new instance that is the intersection of this collection and the provided collection.
参数名称 | 类型 | 描述信息 |
---|---|---|
other |
TimeIntervalCollection | The collection to intersect with. |
dataComparer |
TimeInterval.DataComparer | 可选 A function which compares the data of the two intervals. If omitted, reference equality is used. |
mergeCallback |
TimeInterval.MergeCallback | 可选 A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. |
返回值:
A new TimeIntervalCollection which is the intersection of this collection and the provided collection.
Removes all intervals from the collection.
Removes the specified interval from this interval collection, creating a hole over the specified interval.
The data property of the input interval is ignored.
参数名称 | 类型 | 描述信息 |
---|---|---|
interval |
TimeInterval | The interval to remove. |
返回值:
true
if the interval was removed, false
if no part of the interval was in the collection.