Package coneforest.psylla.core
Class PsyBlockingQueue
- java.lang.Object
-
- coneforest.psylla.core.PsyBlockingQueue
-
- All Implemented Interfaces:
PsyBounded,PsyClearable,PsyCloseable,PsyContainer<PsyObject>,PsyConvertableToName,PsyConvertableToString,PsyFormalQueue<PsyObject>,PsyIterable<PsyObject>,PsyLengthy,PsyObject,PsySequential<PsyObject>,PsyStreamable<PsyObject>,Iterable<PsyObject>
public class PsyBlockingQueue extends Object implements PsyFormalQueue<PsyObject>, PsyCloseable
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Constructor Summary
Constructors Constructor Description PsyBlockingQueue(PsyInteger oCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcapacity()Returns the capacity of this container.Iterator<PsyObject>iterator()intlength()Returns the number of elements in this queue.voidpsyClear()Clear this object.voidpsyClose()Closes this object.PsyObjectpsyDequeue()Removes and returns the head of this queue.voidpsyEnqueue(PsyObject o)Inserts an element into this queue.voidpsyGive(PsyObject o)PsyStreampsyStream()PsyObjectpsyTake()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface coneforest.psylla.core.PsyBounded
isFull, psyCapacity, psyIsFull
-
Methods inherited from interface coneforest.psylla.core.PsyContainer
psyNewEmpty, toSyntaxStringHelper
-
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyToArray, psyUnite
-
Methods inherited from interface coneforest.psylla.core.PsyLengthy
isEmpty, psyIsEmpty, psyLength
-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, toSyntaxString, typeName
-
Methods inherited from interface coneforest.psylla.core.PsyStreamable
psyForAll
-
-
-
-
Field Detail
-
OPERATORS
public static final PsyOperator[] OPERATORS
-
-
Constructor Detail
-
PsyBlockingQueue
public PsyBlockingQueue(PsyInteger oCapacity) throws PsyException
- Throws:
PsyException
-
-
Method Detail
-
length
public int length()
Returns the number of elements in this queue.- Specified by:
lengthin interfacePsyLengthy- Returns:
- the number of elements in this queue.
-
psyGive
public void psyGive(PsyObject o) throws PsyException
- Specified by:
psyGivein interfacePsyFormalQueue<PsyObject>- Throws:
PsyException
-
psyEnqueue
public void psyEnqueue(PsyObject o) throws PsyException
Description copied from interface:PsyFormalQueueInserts an element into this queue.- Specified by:
psyEnqueuein interfacePsyFormalQueue<PsyObject>- Parameters:
o- the element to enqueue.- Throws:
PsyException- when the element can not be inserted without violation of the capacity restrictions.
-
psyDequeue
public PsyObject psyDequeue() throws PsyException
Description copied from interface:PsyFormalQueueRemoves and returns the head of this queue.- Specified by:
psyDequeuein interfacePsyFormalQueue<PsyObject>- Returns:
- a head of this queue.
- Throws:
PsyException- when this queue is empty.
-
psyTake
public PsyObject psyTake() throws PsyException
- Specified by:
psyTakein interfacePsyFormalQueue<PsyObject>- Throws:
PsyException
-
psyClose
public void psyClose()
Description copied from interface:PsyCloseableCloses this object.- Specified by:
psyClosein interfacePsyCloseable
-
psyClear
public void psyClear()
Description copied from interface:PsyClearableClear this object.- Specified by:
psyClearin interfacePsyClearable
-
capacity
public int capacity()
Description copied from interface:PsyBoundedReturns the capacity of this container.- Specified by:
capacityin interfacePsyBounded- Returns:
- the capacity of this container.
-
psyStream
public PsyStream psyStream()
- Specified by:
psyStreamin interfacePsyIterable<PsyObject>- Specified by:
psyStreamin interfacePsyStreamable<PsyObject>
-
-