new Cesium.Queue()

队列可以将项目排在尾部, 并且从前面调离项目 .

Members

readonly length : number

队列的长度 .

Methods

clear()

删除队列中的所有项目 .

contains(item)

检查此队列是否包含指定的项目 .
Name Type Description
item * 要搜索的项目 .

dequeue()*

调试一个项目。 如果队列为空, 返回未定义 .
Returns:
解序项.

enqueue(item)

选中指定项目 .
Name Type Description
item * The item to enqueue.

peek()*

返回队列前方的项目。 如果队列为空, 返回未定义 .
Returns:
队列前方的项目 .

sort(compareFunction)

在位置排序队列中的项目.
Name Type Description
compareFunction Queue.Comparator 定义排序顺序的函数 .

Type Definitions

Cesium.Queue.Comparator(a, b)number

用于在排序队列时比较两个项目的函数 .
Name Type Description
a * 阵列中的一个项目 .
b * 阵列中的一个项目 .
Returns:
如果 NT 0 a NT 1 小于 NT 2 b NT 3 ,则返回负值, 如果 NT 0 a NT 1 大于 NT 2 b NT 3 ,则为正值,或 0 如果 a 等于 b .
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.