Queue

new Cesium.Queue()

一个队列,可以在末尾将项目排入队列,并从前面取消项目排队。

Members

readonly length : number

队列的长度。

Methods

从队列中删除所有项目。
检查此队列是否包含指定项。
Name Type Description
item * 要搜索的项目。
取消项目排队。 如果队列为空,则返回 undefined。
Returns:
已取消排队的项目。
将指定项排入队列。
Name Type Description
item * 要入队的项目。
返回队列前面的项目。 如果队列为空,则返回 undefined。
Returns:
队列前面的项目。

sort(compareFunction)

就地对队列中的项目进行排序。
Name Type Description
compareFunction Queue.Comparator 定义排序顺序的函数。

Type Definitions

Cesium.Queue.Comparator(a, b)number

用于在对队列进行排序时比较两个项目的函数。
Name Type Description
a * 数组中的一项。
b * 数组中的一项。
Returns:
如果 a 小于 b,则返回负值, 如果 a 大于 b,则为正值,或 如果 a 等于 b,则为 0。
Example:
function compareNumbers(a, b) {
    return a - b;
}
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.