org.terracotta.management.stats
Enum MemoryUnit

java.lang.Object
  extended by java.lang.Enum<MemoryUnit>
      extended by org.terracotta.management.stats.MemoryUnit
All Implemented Interfaces:
Serializable, Comparable<MemoryUnit>

public enum MemoryUnit
extends Enum<MemoryUnit>

Author:
Ludovic Orban

Enum Constant Summary
B
          Bytes unit.
GB
          Gigabytes unit.
KB
          Kilobytes unit.
MB
          Megabytes unit.
PB
          Petabytes unit.
TB
          Terabytes unit.
 
Method Summary
 long toBytes(long size)
          Returns the size in bytes according to the unit this is invoked on.
static MemoryUnit valueOf(String name)
          Returns the enum constant of this type with the specified name.
static MemoryUnit[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

B

public static final MemoryUnit B
Bytes unit.


KB

public static final MemoryUnit KB
Kilobytes unit.


MB

public static final MemoryUnit MB
Megabytes unit.


GB

public static final MemoryUnit GB
Gigabytes unit.


TB

public static final MemoryUnit TB
Terabytes unit.


PB

public static final MemoryUnit PB
Petabytes unit.

Method Detail

values

public static MemoryUnit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MemoryUnit c : MemoryUnit.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MemoryUnit valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toBytes

public long toBytes(long size)
Returns the size in bytes according to the unit this is invoked on.

Parameters:
size - the size, relative to the unit
Returns:
the size in bytes


Copyright © 2016. All Rights Reserved.