final class BarrierManager
extends java.lang.Object
NetBarrier
Modifier and Type | Field and Description |
---|---|
private java.util.Hashtable |
barriers
The table containing the Barriers.
|
private static int |
index
The index for the next Barrier to be created.
|
private static BarrierManager |
instance
Singleton instance of the BarrierManager
|
Modifier | Constructor and Description |
---|---|
private |
BarrierManager()
Private default constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
create(BarrierData bd)
Allocates a new number to the Barrier, and stores it in the table.
|
(package private) void |
create(int idx,
BarrierData bd)
Stores a barrier with the given index in the table.
|
(package private) BarrierData |
getBarrier(int idx)
Retrieves a barrier from the table
|
(package private) static BarrierManager |
getInstance()
Allows getting of the singleton instance.
|
(package private) void |
removeBarrier(BarrierData data)
Removes the given barrier from the table of barriers.
|
private static int index
private final java.util.Hashtable barriers
private static BarrierManager instance
private BarrierManager()
static BarrierManager getInstance()
void create(BarrierData bd)
bd
- The BarrierData for the Barriervoid create(int idx, BarrierData bd) throws java.lang.IllegalArgumentException
idx
- The index to use for the barrierbd
- The BarrierData representing the barrierjava.lang.IllegalArgumentException
- If a barrier of the given index already exists.BarrierData getBarrier(int idx)
idx
- Index in the table to retrieve the barrier from.void removeBarrier(BarrierData data)
data
- The BarrierData object of the barrier to be removed