models

Class ConcurrentLinkedQueue

lucee.Component
    extended by models.ConcurrentLinkedQueue

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com ---- A concurrent non-blocking linked queue (FIFO) modeled after the Java counterpart.

Class Attributes:
  • synchronized : false
  •  
  • see : https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ConcurrentLinkedQueue.html
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Luis Majano
  •  
    Property Summary
    type property default serializable required
    any jQueue
          The native java ConcurrentLinkedQueue.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init([any list='[runtime expression]'])
          Constructor.
    Method Summary
    ConcurrentLinkedQueue add(any element)
         Inserts the specified element at the tail of this queue.
    ConcurrentLinkedQueue addAll(array collection)
         Appends all of the elements in the specified collection to the end of this queue, in the order that they are returned by the specified collection's iterator.
    ConcurrentLinkedQueue clear()
         Removes all of the elements from this queue.
    ConcurrentLinkedQueue clone()
         Creates and returns a copy of this object.
    boolean containsAll(array collection)
         Returns true if this collection contains all of the elements in the specified collection.
    string getJQueue()
    boolean has(any element)
         Returns true if this queue contains the specified element.
    boolean has(any element)
         Returns true if this queue contains the specified element.
    boolean isEmpty()
         Returns true if this queue contains no elements.
    any iterator()
         Returns an iterator over the elements in this queue in proper sequence.
    ConcurrentLinkedQueue offer(any element)
         Inserts the specified element at the tail of this queue.
    any parallelStream()
         Returns a possibly parallel Stream with this collection as its source.
    any peek()
         Retrieves, but does not remove, the head of this queue, or returns null if this queue is empty.
    any poll()
         Retrieves and removes the head of this queue, or returns null if this queue is empty.
    boolean remove([any element])
         Retrieves and removes the head of this queue.
    boolean removeAll(array collection)
         Removes all of this collection's elements that are also contained in the specified collection (optional operation).
    boolean retainAll(array collection)
         Retains only the elements in this collection that are contained in the specified collection (optional operation).
    any setJQueue(any jQueue)
    numeric size()
         Returns the number of elements in this queue.
    any spliterator()
         Returns a Spliterator over the elements in this queue.
    any stream()
         Returns a sequential Stream with this collection as its source.
    array toArray([boolean native='true'])
         Returns an array containing all of the elements in this queue, in proper sequence.
    string toString()
         Returns a string representation of this collection.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init([any list='[runtime expression]'])

    Constructor

    Parameters:
    list - true

    Property Detail

    jQueue

    property any jQueue

    The native java ConcurrentLinkedQueue

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    add

    public ConcurrentLinkedQueue add(any element)

    Inserts the specified element at the tail of this queue.

    Parameters:
    element - The element to add to the queue

    addAll

    public ConcurrentLinkedQueue addAll(array collection)

    Appends all of the elements in the specified collection to the end of this queue, in the order that they are returned by the specified collection's iterator.

    Parameters:
    collection - An array collection to add into the queue as elements

    clear

    public ConcurrentLinkedQueue clear()

    Removes all of the elements from this queue. The queue will be empty after this call returns.


    clone

    public ConcurrentLinkedQueue clone()

    Creates and returns a copy of this object.


    containsAll

    public boolean containsAll(array collection)

    Returns true if this collection contains all of the elements in the specified collection.

    Parameters:
    collection - Collection to be checked for containment in this collection
    Returns:
    true if this collection contains all of the elements in the specified collection

    getJQueue

    public string getJQueue()


    has

    public boolean has(any element)

    Returns true if this queue contains the specified element.

    Parameters:
    element

    has

    public boolean has(any element)

    Returns true if this queue contains the specified element.

    Parameters:
    element

    isEmpty

    public boolean isEmpty()

    Returns true if this queue contains no elements.


    iterator

    public any iterator()

    Returns an iterator over the elements in this queue in proper sequence.


    offer

    public ConcurrentLinkedQueue offer(any element)

    Inserts the specified element at the tail of this queue.

    Parameters:
    element - The element to add at the tail

    parallelStream

    public any parallelStream()

    Returns a possibly parallel Stream with this collection as its source. It is allowable for this method to return a sequential stream.


    peek

    public any peek()

    Retrieves, but does not remove, the head of this queue, or returns null if this queue is empty.

    Returns:
    The head of this queue, or null if this queue is empty

    poll

    public any poll()

    Retrieves and removes the head of this queue, or returns null if this queue is empty.

    Returns:
    The head of this queue, or null if this queue is empty

    remove

    public boolean remove([any element])

    Retrieves and removes the head of this queue. This method differs from poll only in that it throws an exception if this queue is empty. If you pass in the `element` argument, then we will try to remove the element from the queue instead.

    Parameters:
    element - If passed, it will remove the element.
    Returns:
    The head of this queue
    Throws:
    NoSuchElementException - if this queue is empty

    removeAll

    public boolean removeAll(array collection)

    Removes all of this collection's elements that are also contained in the specified collection (optional operation).

    Parameters:
    collection - The array of elements to remove

    retainAll

    public boolean retainAll(array collection)

    Retains only the elements in this collection that are contained in the specified collection (optional operation).

    Parameters:
    collection - The array of elements to retain

    setJQueue

    public any setJQueue(any jQueue)

    Parameters:
    jQueue

    size

    public numeric size()

    Returns the number of elements in this queue.


    spliterator

    public any spliterator()

    Returns a Spliterator over the elements in this queue.


    stream

    public any stream()

    Returns a sequential Stream with this collection as its source.


    toArray

    public array toArray([boolean native='true'])

    Returns an array containing all of the elements in this queue, in proper sequence.

    Parameters:
    native - If true, then it returns a native CFML array, else a Java Array Collection

    toString

    public string toString()

    Returns a string representation of this collection. The string representation consists of a list of the collection's elements in the order they are returned by its iterator, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space). Elements are converted to strings as by String.valueOf(Object).