|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rabbitmq.utility.IntAllocator
public class IntAllocator
A class for allocating integer IDs in a given range.
Constructor Summary | |
---|---|
IntAllocator(int start,
int end)
Creates an IntAllocator allocating integer IDs within the inclusive range [start, end] |
Method Summary | |
---|---|
int |
allocate()
Allocate a fresh integer from the range, or return -1 if no more integers are available. |
void |
flush()
|
void |
free(int id)
Make the provided integer available for allocation again. |
static com.rabbitmq.utility.IntAllocator.IntervalList |
fromArray(int[] xs,
int length)
|
static com.rabbitmq.utility.IntAllocator.IntervalList |
merge(com.rabbitmq.utility.IntAllocator.IntervalList x,
com.rabbitmq.utility.IntAllocator.IntervalList y)
Destructively merge two IntervalLists. |
boolean |
reserve(int id)
Attempt to reserve the provided ID as if it had been allocated. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IntAllocator(int start, int end)
Method Detail |
---|
public static com.rabbitmq.utility.IntAllocator.IntervalList merge(com.rabbitmq.utility.IntAllocator.IntervalList x, com.rabbitmq.utility.IntAllocator.IntervalList y)
public static com.rabbitmq.utility.IntAllocator.IntervalList fromArray(int[] xs, int length)
public int allocate()
public void free(int id)
public boolean reserve(int id)
public void flush()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |