All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.cesium.Queue.kt Maven / Gradle / Ivy

There is a newer version: 1.90.0-10
Show newest version
// Automatically generated - do not modify!

@file:Suppress(
    "NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE",
)

package cesium

/**
 * A queue that can enqueue items at the end, and dequeue items from the front.
 * @see Online Documentation
 */
@JsName("\$cesium__Queue")
external class Queue {
    /**
     * The length of the queue.
     * @see Online Documentation
     */
    val length: Int

    /**
     * Enqueues the specified item.
     * @param [item] The item to enqueue.
     * @see Online Documentation
     */
    fun enqueue(item: Any)

    /**
     * Dequeues an item.  Returns undefined if the queue is empty.
     * @return The the dequeued item.
     * @see Online Documentation
     */
    fun dequeue(): Any

    /**
     * Returns the item at the front of the queue.  Returns undefined if the queue is empty.
     * @return The item at the front of the queue.
     * @see Online Documentation
     */
    fun peek(): Any

    /**
     * Check whether this queue contains the specified item.
     * @param [item] The item to search for.
     * @see Online Documentation
     */
    fun contains(item: Any)

    /**
     * Remove all items from the queue.
     * @see Online Documentation
     */
    fun clear()

    /**
     * Sort the items in the queue in-place.
     * @param [compareFunction] A function that defines the sort order.
     * @see Online Documentation
     */
    fun sort(compareFunction: Comparator)
}

/**
 * A function used to compare two items while sorting a queue.
 * ```
 * function compareNumbers(a, b) {
 *     return a - b;
 * }
 * ```
 * @param [a] An item in the array.
 * @param [b] An item in the array.
 * @see Online Documentation
 */
typealias Comparator = (a: Any, b: Any) -> Double




© 2015 - 2024 Weber Informatics LLC | Privacy Policy