@JsType(isNative=true, namespace="Cesium", name="TimeIntervalCollection") public class TimeIntervalCollection extends Object
Constructor and Description |
---|
TimeIntervalCollection()
A non-overlapping collection of
TimeInterval instances sorted by start time. |
TimeIntervalCollection(TimeInterval[] intervals)
A non-overlapping collection of
TimeInterval instances sorted by start time. |
Modifier and Type | Method and Description |
---|---|
void |
addInterval(TimeInterval interval)
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.
|
void |
addInterval(TimeInterval interval,
TimeInterval.DataComparer dataComparer)
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.
|
Event |
changedEvent()
Gets an event that is raised whenever the collection of intervals change.
|
boolean |
contains(JulianDate julianDate)
Checks if the specified date is inside this collection.
|
boolean |
equals(TimeIntervalCollection right)
Compares this instance against the provided instance componentwise and returns true if they are equal, false otherwise.
|
boolean |
equals(TimeIntervalCollection right,
TimeInterval.DataComparer dataComparer)
Compares this instance against the provided instance componentwise and returns true if they are equal, false otherwise.
|
Object |
findDataForIntervalContainingDate(JulianDate date)
Finds and returns the data for the interval that contains the specified date.
|
TimeInterval |
findInterval()
Returns the first interval in the collection that matches the specified parameters.
|
TimeInterval |
findInterval(TimeIntervalOptions options)
Returns the first interval in the collection that matches the specified parameters.
|
TimeInterval |
findIntervalContainingDate(JulianDate date)
The date to search for.
|
static TimeIntervalCollection |
fromIso8601(FromIso8601Options options)
Creates a new instance from an ISO 8601 time interval (start/end/duration).
|
static TimeIntervalCollection |
fromIso8601(FromIso8601Options options,
TimeIntervalCollection result)
Creates a new instance from an ISO 8601 time interval (start/end/duration).
|
static TimeIntervalCollection |
fromIso8601DateArray(FromIso8601DateArrayOptions options)
Creates a new instance from a ISO 8601 date array.
|
static TimeIntervalCollection |
fromIso8601DateArray(FromIso8601DateArrayOptions options,
TimeIntervalCollection result)
Creates a new instance from a ISO 8601 date array.
|
static TimeIntervalCollection |
fromIso8601DurationArray(FromIso8601DurationArrayOptions options)
Creates a new instance from a ISO 8601 duration array.
|
static TimeIntervalCollection |
fromIso8601DurationArray(FromIso8601DurationArrayOptions options,
TimeIntervalCollection result)
Creates a new instance from a ISO 8601 duration array.
|
static TimeIntervalCollection |
fromJulianDateArray(FromJulianDateArrayOptions options)
Creates a new instance from a JulianDate array.
|
static TimeIntervalCollection |
fromJulianDateArray(FromJulianDateArrayOptions options,
TimeIntervalCollection result)
Creates a new instance from a JulianDate array.
|
TimeInterval |
get(int index)
Gets the interval at the specified index.
|
int |
indexOf(JulianDate date)
Finds and returns the index of the interval in the collection that contains the specified date.
|
TimeIntervalCollection |
intersect(TimeIntervalCollection other)
Creates a new instance that is the intersection of this collection and the provided collection.
|
TimeIntervalCollection |
intersect(TimeIntervalCollection other,
TimeInterval.DataComparer dataComparer)
Creates a new instance that is the intersection of this collection and the provided collection.
|
TimeIntervalCollection |
intersect(TimeIntervalCollection other,
TimeInterval.DataComparer dataComparer,
TimeInterval.MergeCallback mergeCallback)
Creates a new instance that is the intersection of this collection and the provided collection.
|
boolean |
isEmpty()
Gets whether or not the collection is empty.
|
boolean |
isStartIncluded()
Gets whether or not the start time is included in the collection.
|
boolean |
isStopIncluded()
Gets whether or not the stop time is included in the collection.
|
int |
length()
Gets the number of intervals in the collection.
|
void |
removeAll()
Removes all intervals from the collection.
|
void |
removeInterval(TimeInterval interval)
Removes the specified interval from this interval collection, creating a hole over the specified interval.
|
JulianDate |
start()
Gets the start time of the collection.
|
JulianDate |
stop()
Gets the stop time of the collection.
|
@JsConstructor public TimeIntervalCollection()
TimeInterval
instances sorted by start time.@JsConstructor public TimeIntervalCollection(TimeInterval[] intervals)
TimeInterval
instances sorted by start time.intervals
- An array of intervals to add to the collection.@JsProperty(name="changedEvent") public Event changedEvent()
@JsProperty(name="isEmpty") public boolean isEmpty()
@JsProperty(name="isStartIncluded") public boolean isStartIncluded()
@JsProperty(name="isStopIncluded") public boolean isStopIncluded()
@JsProperty(name="length") public int length()
@JsProperty(name="start") public JulianDate start()
@JsProperty(name="stop") public JulianDate stop()
@JsMethod public static TimeIntervalCollection fromIso8601(FromIso8601Options options)
options
- FromIso8601Options
@JsMethod public static TimeIntervalCollection fromIso8601(FromIso8601Options options, TimeIntervalCollection result)
options
- FromIso8601Options
result
- An existing instance to use for the result.@JsMethod public static TimeIntervalCollection fromIso8601DateArray(FromIso8601DateArrayOptions options)
options
- FromIso8601DateArrayOptions
@JsMethod public static TimeIntervalCollection fromIso8601DateArray(FromIso8601DateArrayOptions options, TimeIntervalCollection result)
options
- FromIso8601DateArrayOptions
result
- An existing instance to use for the result.@JsMethod public static TimeIntervalCollection fromIso8601DurationArray(FromIso8601DurationArrayOptions options)
options
- FromIso8601DurationArrayOptions
@JsMethod public static TimeIntervalCollection fromIso8601DurationArray(FromIso8601DurationArrayOptions options, TimeIntervalCollection result)
options
- FromIso8601DurationArrayOptions
result
- An existing instance to use for the result.@JsMethod public static TimeIntervalCollection fromJulianDateArray(FromJulianDateArrayOptions options)
options
- FromJulianDateArrayOptions
.@JsMethod public static TimeIntervalCollection fromJulianDateArray(FromJulianDateArrayOptions options, TimeIntervalCollection result)
options
- FromJulianDateArrayOptions
.result
- An existing instance to use for the result.@JsMethod public void addInterval(TimeInterval interval)
interval
- The interval to add.@JsMethod public void addInterval(TimeInterval interval, TimeInterval.DataComparer dataComparer)
interval
- The interval to add.dataComparer
- A function which compares the data of the two intervals. If omitted, reference equality is used.@JsMethod public boolean contains(JulianDate julianDate)
julianDate
- The date to check.@JsMethod public boolean equals(TimeIntervalCollection right)
right
- The right hand side collection.public boolean equals(TimeIntervalCollection right, TimeInterval.DataComparer dataComparer)
right
- The right hand side collection.dataComparer
- A function which compares the data of the two intervals. If omitted, reference equality is used.@JsMethod public Object findDataForIntervalContainingDate(JulianDate date)
date
- The date to search for.@JsMethod public TimeInterval findInterval()
@JsMethod public TimeInterval findInterval(TimeIntervalOptions options)
options
- TimeIntervalOptions
@JsMethod public TimeInterval findIntervalContainingDate(JulianDate date)
date
- The date to search for.@JsMethod public TimeInterval get(int index)
index
- The index of the interval to retrieve.@JsMethod public int indexOf(JulianDate date)
date
- The date to search for.@JsMethod public TimeIntervalCollection intersect(TimeIntervalCollection other)
other
- The collection to intersect with.@JsMethod public TimeIntervalCollection intersect(TimeIntervalCollection other, TimeInterval.DataComparer dataComparer)
other
- The collection to intersect with.dataComparer
- A function which compares the data of the two intervals. If omitted, reference equality is used.@JsMethod public TimeIntervalCollection intersect(TimeIntervalCollection other, TimeInterval.DataComparer dataComparer, TimeInterval.MergeCallback mergeCallback)
other
- The collection to intersect with.dataComparer
- A function which compares the data of the two intervals. If omitted, reference equality is used.mergeCallback
- A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.@JsMethod public void removeAll()
@JsMethod public void removeInterval(TimeInterval interval)
interval
- true if the interval was removed, false if no part of the interval was in the collection.Copyright © 2019. All rights reserved.