javax.realtime
Class SizeEstimator

java.lang.Object
  |
  +--javax.realtime.SizeEstimator

public final class SizeEstimator
extends java.lang.Object

This is a convenient class to help people figure out how much memory they need. Instead of passing actual numbers to the MemoryArea constructors, one can pass SizeEstimator objects with which you can have a better feel of how big a memory area you require.

See Also:
MemoryArea.MemoryArea(SizeEstimator), LTMemory.LTMemory(SizeEstimator, SizeEstimator), VTMemory.VTMemory(SizeEstimator, SizeEstimator)

Constructor Summary
SizeEstimator()
           
 
Method Summary
 long getEstimate()
          Returns an estimate of the number of bytes needed to store all the objects reserved.
 void reserve(java.lang.Class c, int n)
          Take into account additional n instances of Class c when estimating the size of the MemoryArea.
 void reserve(SizeEstimator s)
          Take into account an additional instance of SizeEstimator s when estimating the size of the MemoryArea.
 void reserve(SizeEstimator s, int n)
          Take into account additional n instances of SizeEstimator s when estimating the size of the MemoryArea.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SizeEstimator

public SizeEstimator()
Method Detail

reserve

public void reserve(java.lang.Class c,
                    int n)
Take into account additional n instances of Class c when estimating the size of the MemoryArea.
Parameters:
c - The class to take into account.
n - The number of instances of c to estimate.

reserve

public void reserve(SizeEstimator s,
                    int n)
Take into account additional n instances of SizeEstimator s when estimating the size of the MemoryArea.
Parameters:
c - The class to take into account.
n - The number of instances of c to estimate.

reserve

public void reserve(SizeEstimator s)
Take into account an additional instance of SizeEstimator s when estimating the size of the MemoryArea.
Parameters:
c - The class to take into account.
n - The number of instances of c to estimate.

getEstimate

public long getEstimate()
Returns an estimate of the number of bytes needed to store all the objects reserved.