public class ClockSequenceController extends Object
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
pool |
protected static int |
POOL_MAX |
| Constructor and Description |
|---|
ClockSequenceController() |
| Modifier and Type | Method and Description |
|---|---|
int |
borrow(int give,
int take)
Borrow a value from the pool and give back another value to the same
pool.
|
void |
clearPool()
Clear all bits of the byte array that represents the pool.
|
int |
countFree()
Count the free values in the pool.
|
int |
countUsed()
Count the used values out of the pool.
|
boolean |
isFree(int value)
Check if a value is free in the pool.
|
boolean |
isUsed(int value)
Check if a value is used out of the pool.
|
protected byte[] pool
protected static final int POOL_MAX
public int borrow(int give,
int take)
give - value to be given back to the pooltake - value to be taken from the poolpublic boolean isUsed(int value)
value - a value to be checked in the pool.public boolean isFree(int value)
value - a value to be checked in the pool.public int countUsed()
public int countFree()
public void clearPool()
Copyright © 2020. All rights reserved.