|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.realtime.SizeEstimator
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.
Constructor Summary | |
SizeEstimator()
Construct a SizeEstimator . |
Method Summary | |
long |
getEstimate()
Returns an estimate of the number of bytes needed to store all the objects reserved. |
void |
reserve(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
when estimating the size of the MemoryArea . |
void |
reserve(SizeEstimator s,
int n)
Take into account additional n instances of
SizeEstimator when estimating the size of the
MemoryArea . |
void |
reserveArray(int length)
Reserve room in this SizeEstimator for an instance of a
reference array of size length . |
void |
reserveArray(int length,
Class type)
Reserve room in this SizeEstimator for an instance of
an array of primitive values of size length . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SizeEstimator()
SizeEstimator
.
Method Detail |
public long getEstimate()
public void reserve(Class c, int n)
c
when estimating the size of the MemoryArea
.
c
- the class to be consideredn
- the number of instances for which memory needs to be
reserved.public void reserve(SizeEstimator s)
SizeEstimator
when estimating the size of the MemoryArea
.
s
- a SizeEstimator
public void reserve(SizeEstimator s, int n)
n
instances of
SizeEstimator
when estimating the size of the
MemoryArea
.
s
- a SizeEstimator
valuen
- the number of instances.public void reserveArray(int length)
SizeEstimator
for an instance of a
reference array of size length
.
length
- the size of the array to include in the estimate
IllegalArgumentException
- if length
is
negativepublic void reserveArray(int length, Class type)
SizeEstimator
for an instance of
an array of primitive values of size length
.
length
- the size of the array to include in the estimatetype
- the class representing a primitive type to use for
the array estimate
IllegalArgumentException
- if length
is
negative
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |