|
||||||||||
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.
Field Summary | |
protected int |
allocationNumber
|
protected long |
estimate
|
Constructor Summary | |
SizeEstimator()
|
Method Summary | |
int |
getAllocationNumber()
|
long |
getEstimate()
Returns an estimate of the number of bytes needed to store all the objects reserved. |
void |
reserve(Class c)
Take into account one additional instance of Class
c when estimating the size of the MemoryArea . |
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 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 |
Field Detail |
protected long estimate
protected int allocationNumber
Constructor Detail |
public SizeEstimator()
Method Detail |
public long getEstimate()
public void reserve(Class c, int n)
Class
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(Class c)
Class
c
when estimating the size of the MemoryArea
.
c
- the class to be consideredpublic void reserve(SizeEstimator s)
SizeEstimator s
when estimating the size of the MemoryArea
.
s
- a SizeEstimator
public void reserve(SizeEstimator s, int n)
n
instances of
SizeEstimator s
when estimating the size of the
MemoryArea
.
s
- a SizeEstimator
valuen
- the number of instances.public int getAllocationNumber()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |