|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jclass.DynamicNumbers
A class able to dynamically allocate and dealocate unique numbers in a given range.
Once allocated, a number must be freed in order to be allocable again.
Written: Radu Sion
Version: 0.14x
Source: DynamicNumbers.java
Visit
Smart Software
Constructor Summary | |
DynamicNumbers(int maxrange)
|
Method Summary | |
void |
freeNumber(int nr)
Deallocates a number. |
int |
getFreeNumber()
Allocates a new unique number in the given range. |
int |
getRange()
Returns the number that was passed as parameter to the constructor. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DynamicNumbers(int maxrange)
maxrange
- The range in which to allocate numbers. The numbers will be allocated in the range 1 to maxrangeMethod Detail |
public int getFreeNumber() throws FullException
public void freeNumber(int nr)
nr
- The number to dealocatepublic int getRange()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |