@Deprecated public class IncubationQueue<T> extends Object
Example:
IncubationQueue q = new IncubationQueue();
q.incubate("a");
q.incubate("b");
q.incubate("c");
q.hatch("b");
q.removeNextHatchedIfAvailable(); // returns null
q.hatch("a");
q.removeNextHatched(); // returns "a"
q.removeNextHatched(); // returns "b"
q.removeNextHatchedIfAvailable(); // returns null
q.hatch("c");
q.removeNextHatched(); // returns "c"
| Modifier and Type | Field and Description |
|---|---|
static int |
maxWaitTime
Deprecated.
Maximum wait time in milliseconds for blocking operations, such as
getNext() and
waitUntilIncubated(Object). |
| Constructor and Description |
|---|
IncubationQueue()
Deprecated.
Create new Incubation queue that compares with equals()/hashCode
|
IncubationQueue(boolean identityComparison)
Deprecated.
Create new Incubation queue
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Deprecated.
clear.
|
boolean |
contains(T o)
Deprecated.
contains.
|
T |
getNext()
Deprecated.
getNext.
|
T |
getNextHatched()
Deprecated.
Get next hatched object, blocks if empty or unhatched
|
T |
getNextHatchedIfAvailable()
Deprecated.
Get next hatched object
|
boolean |
hatch(T o)
Deprecated.
Hatch incubating object o.
|
void |
incubate(T o)
Deprecated.
Add object to the queue
|
boolean |
isEmpty()
Deprecated.
isEmpty.
|
boolean |
isHatched(T o)
Deprecated.
isHatched.
|
boolean |
isIncubating(T o)
Deprecated.
isIncubating.
|
Iterator<T> |
iterator()
Deprecated.
Non-thread safe iterator.
|
boolean |
nextIsHatched()
Deprecated.
Is next object hatched
|
T |
removeNextHatched()
Deprecated.
Remove next hatched object.
|
T |
removeNextHatchedIfAvailable()
Deprecated.
Remove next hatched object if available
|
T |
removeNextHatchedUninterruptibly()
Deprecated.
Remove next hatched object.
|
int |
size()
Deprecated.
size.
|
void |
waitUntilIncubated(T o)
Deprecated.
waitUntilIncubated.
|
public static int maxWaitTime
getNext() and
waitUntilIncubated(Object). Default 60000 (ms).public IncubationQueue()
public IncubationQueue(boolean identityComparison)
identityComparison - if true objects are compared with ==, false compare with
equals()/hashCode()public void clear()
clear.
public boolean contains(T o)
contains.
o - a T object.public T getNext() throws InterruptedException
getNext.
InterruptedException - if any.public T getNextHatched() throws InterruptedException
InterruptedException - if any.public T getNextHatchedIfAvailable()
public boolean hatch(T o) throws IllegalArgumentException
o - object not nullIllegalArgumentException - if o was not incubatingpublic void incubate(T o)
o - object not null and not in queuepublic boolean isEmpty()
isEmpty.
public boolean isHatched(T o)
isHatched.
o - a T object.public boolean isIncubating(T o)
isIncubating.
o - a T object.public Iterator<T> iterator()
public boolean nextIsHatched()
public T removeNextHatched() throws InterruptedException
InterruptedException - if any.public T removeNextHatchedIfAvailable()
public T removeNextHatchedUninterruptibly()
public int size()
size.
public void waitUntilIncubated(T o) throws InterruptedException
waitUntilIncubated.
o - a T object.InterruptedException - if any.Copyright © 2026. All rights reserved.