Class Units
java.lang.Object
com.tangosol.coherence.config.unit.Units
Units
is a union of MemorySize
and unit count.
Note: This class is provided to support the high-units configuration property
which can either be a memory size string or the number of units. The default
unit calculator depends on whether the configuration explicitly specified
a memory size (e.g. <high-units>20M</high-units>).- Since:
- Coherence 12.1.2
- Author:
- bo 2012.08.27, pfm 2012.08.27
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.oracle.coherence.common.util.MemorySize
Return theMemorySize
.long
Return the unit count.boolean
Return true if Units contains aMemorySize
.
-
Constructor Details
-
Units
Construct a Units object. If the sValue is a MemorySize string (e.g. 10M) then this instance of Units explicitly represents a MemorySize. Otherwise, this instance contains a unit count.- Parameters:
sValue
- the unit count or memory size
-
Units
public Units(long cUnits) Construct a Units object with the given unit count.- Parameters:
cUnits
- the unit count
-
Units
public Units(com.oracle.coherence.common.util.MemorySize memorySize) Construct a Units object with the givenMemorySize
.- Parameters:
memorySize
- theMemorySize
-
-
Method Details
-
getUnitCount
public long getUnitCount()Return the unit count. If this object was constructed with MemorySize then the count will be the number of bytes.- Returns:
- the unit count
-
getMemorySize
public com.oracle.coherence.common.util.MemorySize getMemorySize()Return theMemorySize
. If this object was constructed with a unit count thenMemorySize
will be null.- Returns:
- the
MemorySize
or null
-
isMemorySize
public boolean isMemorySize()Return true if Units contains aMemorySize
.- Returns:
- true if Units contains a
MemorySize
-