Class NonblockingQueue<T>

  • All Implemented Interfaces:
    Queue4<T>

    public class NonblockingQueue<T>
    extends java.lang.Object
    implements Queue4<T>
    Unbounded queue.
    • Constructor Detail

      • NonblockingQueue

        public NonblockingQueue()
    • Method Detail

      • add

        public final void add​(T obj)
        Specified by:
        add in interface Queue4<T>
      • next

        public final T next()
        Specified by:
        next in interface Queue4<T>
      • nextMatching

        public T nextMatching​(Predicate4<T> condition)
        Description copied from interface: Queue4
        Returns the next object in the queue that matches the specified condition. The operation is always NON-BLOCKING.
        Specified by:
        nextMatching in interface Queue4<T>
        Parameters:
        condition - the object must satisfy to be returned
        Returns:
        the object satisfying the condition or null if none does
      • hasNext

        public final boolean hasNext()
        Specified by:
        hasNext in interface Queue4<T>