Class Units

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

public class Units extends 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

    Constructors
    Constructor
    Description
    Units(long cUnits)
    Construct a Units object with the given unit count.
    Units(com.oracle.coherence.common.util.MemorySize memorySize)
    Construct a Units object with the given MemorySize.
    Units(String sValue)
    Construct a Units object.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.oracle.coherence.common.util.MemorySize
    Return the MemorySize.
    long
    Return the unit count.
    boolean
    Return true if Units contains a MemorySize.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • 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 given MemorySize.
      Parameters:
      memorySize - the MemorySize
  • 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 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