Package coneforest.psylla.core
Class PsyBlockingQueue
- java.lang.Object
-
- coneforest.psylla.core.PsyBlockingQueue
-
- All Implemented Interfaces:
PsyBounded
,PsyClearable
,PsyCloseable
,PsyContainer<PsyObject>
,PsyConvertableToName
,PsyConvertableToString
,PsyIterable<PsyObject>
,PsyLengthy
,PsyObject
,PsyQueuelike<PsyObject>
,PsyStreamlike<PsyObject>
,Iterable<PsyObject>
public class PsyBlockingQueue extends Object implements PsyQueuelike<PsyObject>, PsyCloseable
-
-
Constructor Summary
Constructors Constructor Description PsyBlockingQueue(PsyInteger oCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
capacity()
Returns the capacity of this container.Iterator<PsyObject>
iterator()
int
length()
Returns the number of elements in this queue.void
psyClear()
Clear this object.void
psyClose()
Close this object.PsyObject
psyDequeue()
Removes and returns the head of this queue.void
psyEnqueue(PsyObject o)
Inserts an element into this queue.void
psyGive(PsyObject o)
PsyStream
psyStream()
PsyObject
psyTake()
-
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
-
Methods inherited from interface coneforest.psylla.core.PsyIterable
psyCount, psyFilter, psyForAll, psyMap, 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.PsyStreamlike
psyConcat
-
-
-
-
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:
length
in interfacePsyLengthy
- Returns:
- the number of elements in this queue.
-
psyGive
public void psyGive(PsyObject o) throws PsyException
- Specified by:
psyGive
in interfacePsyQueuelike<PsyObject>
- Throws:
PsyException
-
psyEnqueue
public void psyEnqueue(PsyObject o) throws PsyException
Description copied from interface:PsyQueuelike
Inserts an element into this queue.- Specified by:
psyEnqueue
in interfacePsyQueuelike<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:PsyQueuelike
Removes and returns the head of this queue.- Specified by:
psyDequeue
in interfacePsyQueuelike<PsyObject>
- Returns:
- a head of this queue.
- Throws:
PsyException
- when this queue is empty.
-
psyTake
public PsyObject psyTake() throws PsyException
- Specified by:
psyTake
in interfacePsyQueuelike<PsyObject>
- Throws:
PsyException
-
psyClose
public void psyClose()
Description copied from interface:PsyCloseable
Close this object.- Specified by:
psyClose
in interfacePsyCloseable
-
psyClear
public void psyClear()
Description copied from interface:PsyClearable
Clear this object.- Specified by:
psyClear
in interfacePsyClearable
-
capacity
public int capacity()
Description copied from interface:PsyBounded
Returns the capacity of this container.- Specified by:
capacity
in interfacePsyBounded
- Returns:
- the capacity of this container.
-
psyStream
public PsyStream psyStream()
- Specified by:
psyStream
in interfacePsyIterable<PsyObject>
-
-