Class Units
- java.lang.Object
-
- com.tangosol.coherence.config.unit.Units
-
public class Units extends Object
Units
is a union ofMemorySize
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.oracle.coherence.common.util.MemorySize
getMemorySize()
Return theMemorySize
.long
getUnitCount()
Return the unit count.boolean
isMemorySize()
Return true if Units contains aMemorySize
.
-
-
-
Constructor Detail
-
Units
public Units(String sValue)
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 Detail
-
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
-
-