Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.coherence.config.unit
Class Units

java.lang.Object
  extended by com.tangosol.coherence.config.unit.Units


public class Units
extends java.lang.Object

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
Units(long cUnits)
          Construct a Units object with the given unit count.
Units(com.oracle.common.util.MemorySize memorySize)
          Construct a Units object with the given MemorySize.
Units(java.lang.String sValue)
          Construct a Units object.

 

Method Summary
 com.oracle.common.util.MemorySize getMemorySize()
          Return the MemorySize.
 long getUnitCount()
          Return the unit count.
 boolean isMemorySize()
          Return true if Units contains a MemorySize.

 

Constructor Detail

Units

public Units(java.lang.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.common.util.MemorySize memorySize)
Construct a Units object with the given MemorySize.
Parameters:
memorySize - the MemorySize

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.common.util.MemorySize getMemorySize()
Return the MemorySize. If this object was constructed with a unit count then MemorySize will be null.
Returns:
the MemorySize or null

isMemorySize

public boolean isMemorySize()
Return true if Units contains a MemorySize.
Returns:
true if Units contains a MemorySize

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.