P
- resource pool typepublic class SizedResourcePoolImpl<P extends SizedResourcePool> extends AbstractResourcePool<P,ResourceType<P>> implements SizedResourcePool, HumanReadable
SizedResourcePool
interface.Constructor and Description |
---|
SizedResourcePoolImpl(ResourceType<P> type,
long size,
ResourceUnit unit,
boolean persistent)
Creates a new resource pool based on the provided parameters.
|
Modifier and Type | Method and Description |
---|---|
long |
getSize()
Gets the size of this pool.
|
ResourceUnit |
getUnit()
Gets the unit in which the resource is sized.
|
java.lang.String |
readableString() |
java.lang.String |
toString() |
void |
validateUpdate(ResourcePool newPool)
|
getType, isPersistent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getType, isPersistent
public SizedResourcePoolImpl(ResourceType<P> type, long size, ResourceUnit unit, boolean persistent)
type
- the resource typesize
- the sizeunit
- the unit for the sizepersistent
- whether the pool is to be persistentpublic long getSize()
getSize
in interface SizedResourcePool
public ResourceUnit getUnit()
getUnit
in interface SizedResourcePool
public void validateUpdate(ResourcePool newPool)
validateUpdate
in interface ResourcePool
validateUpdate
in class AbstractResourcePool<P extends SizedResourcePool,ResourceType<P extends SizedResourcePool>>
newPool
- the pool which is the candidate for replacing this ResourcePool
java.lang.IllegalArgumentException
- if newPool
is not a valid replacement for this ResourcePool
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String readableString()
readableString
in interface HumanReadable