E
- the address typepublic class PrefixBlockAllocator<E extends IPAddress> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PrefixBlockAllocator.AllocatedBlock<E extends IPAddress>
Represents a block of addresses allocated for assignment to hosts.
|
Constructor and Description |
---|
PrefixBlockAllocator() |
Modifier and Type | Method and Description |
---|---|
void |
addAvailable(E... newBlocks)
Provides the given blocks to the allocator for allocating.
|
E |
allocateBitLength(int bitLength)
Allocates a block with the given bit-length,
the bit-length being the number of bits extending beyond the prefix length,
or nil if no such block is available in the allocator.
|
PrefixBlockAllocator.AllocatedBlock<E>[] |
allocateBitLengths(int... bitLengths)
Returns multiple blocks of the given bit-lengths,
or null if there is insufficient space in the allocator.
|
E |
allocateSize(long sizeRequired)
Returns a block of sufficient size,
the size indicating the number of distinct addresses required in the block.
|
PrefixBlockAllocator.AllocatedBlock<E>[] |
allocateSizes(long... blockSizes)
Returns multiple blocks of sufficient size for the given size required,
or null if there is insufficient space in the allocator.
|
E[] |
getAvailable()
Returns a list of all the blocks available for allocating in the allocator.
|
int |
getBlockCount()
Returns the count of available blocks in this allocator.
|
int |
getReserved()
Returns the reserved count.
|
BigInteger |
getTotalCount()
Returns the total of the count of all individual addresses available in this allocator,
which is the total number of individual addresses in all the blocks.
|
IPAddress.IPVersion |
getVersion()
Returns the IP version of the available blocks in the allocator,
which is determined by the version of the first block made available to the allocator.
|
void |
setReserved(int reservedCount)
Sets the additional number of addresses to be included in any size allocation.
|
String |
toString()
Returns a string showing the counts of available blocks for each prefix size in the allocator.
|
public int getBlockCount()
public IPAddress.IPVersion getVersion()
public BigInteger getTotalCount()
public void setReserved(int reservedCount)
public int getReserved()
public void addAvailable(E... newBlocks)
public E[] getAvailable()
public E allocateBitLength(int bitLength)
public E allocateSize(long sizeRequired)
sizeRequired
- public PrefixBlockAllocator.AllocatedBlock<E>[] allocateSizes(long... blockSizes)
public PrefixBlockAllocator.AllocatedBlock<E>[] allocateBitLengths(int... bitLengths)