ariba.util.core
Class MemoryStats

java.lang.Object
  extended by ariba.util.core.MemoryStats

public class MemoryStats
extends java.lang.Object

Simple class that captures the current memory situation.


Constructor Summary
MemoryStats(long max, long free, long total)
           
 
Method Summary
 long available()
           
 double availableInMB()
           
 double availablePercentage()
           
static double convertToMB(long bytes)
          Converts a long number of bytes to a double rounded to one decimal place.
 long free()
           
 double freeInMB()
           
static double getAvailablePercentage()
           
static double getAvailablePercentage(long max, long free, long total)
          Returns the free memory as a percentage of max memory in the system for the specified max and free memory.
static MemoryStats getCurrentStats()
          Returns the current memory stats.
 long max()
           
 double maxInMB()
           
 long total()
           
 double totalInMB()
           
 long used()
           
 double usedInMB()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryStats

public MemoryStats(long max,
                   long free,
                   long total)
Method Detail

convertToMB

public static double convertToMB(long bytes)
Converts a long number of bytes to a double rounded to one decimal place.


getCurrentStats

public static MemoryStats getCurrentStats()
Returns the current memory stats.


getAvailablePercentage

public static double getAvailablePercentage(long max,
                                            long free,
                                            long total)
Returns the free memory as a percentage of max memory in the system for the specified max and free memory.


getAvailablePercentage

public static double getAvailablePercentage()

max

public long max()

free

public long free()

total

public long total()

used

public long used()

available

public long available()

maxInMB

public double maxInMB()

freeInMB

public double freeInMB()

usedInMB

public double usedInMB()

totalInMB

public double totalInMB()

availableInMB

public double availableInMB()

availablePercentage

public double availablePercentage()


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.