codesimian
Interface MemoryHog


public interface MemoryHog

a HOG of MEMORY, like a list of prime numbers.

Describes and provides access to the approximate quantity of bytes of an object that implements MemoryHog.

There are 3 categories and 2 subcategories of each...
LEAST, CURRENT, and MOST define 3 points on a continuous scale to measure quantity of bytes on.
AVERAGE and STANDARD DEVIATION define a bell-curve statistics distribution of possible numbers for each of LEAST, CURRENT, and MOST.


Method Summary
 double aveCurrentBytes()
           
 double aveLeastBytes()
           
 double aveMostBytes()
           
 double stdDevCurrentBytes()
           
 double stdDevLeastBytes()
           
 double stdDevMostBytes()
           
 boolean useMoreOrLessMemory(double aveBytes, double maxStdDevBytes, Liquid liq)
          Returns true if changes the approximate quantity of bytes of memory this object uses.
 

Method Detail

aveLeastBytes

double aveLeastBytes()

stdDevLeastBytes

double stdDevLeastBytes()

aveCurrentBytes

double aveCurrentBytes()

stdDevCurrentBytes

double stdDevCurrentBytes()

aveMostBytes

double aveMostBytes()

stdDevMostBytes

double stdDevMostBytes()

useMoreOrLessMemory

boolean useMoreOrLessMemory(double aveBytes,
                            double maxStdDevBytes,
                            Liquid liq)
                            throws NeedLiquid
Returns true if changes the approximate quantity of bytes of memory this object uses. If aveBytes and stdDevBytes cant be approximately satisfied, returns false.

This MemoryHog may have a 'stdDevBytes' less than the parameter maxStdDevBytes, but not greater than it.

For example, if this object is a list of prime numbers, using more memory would generate higher prime numbers and add them, in order, at the end of the list.

To get close to this MemoryHog's memory limits, call this function multiple times (best if in a binary search pattern).

Throws:
NeedLiquid