org.apache.lucene.util
Class MemoryModel

java.lang.Object
  extended by org.apache.lucene.util.MemoryModel
Direct Known Subclasses:
AverageGuessMemoryModel

public abstract class MemoryModel
extends Object

Returns primitive memory sizes for estimating RAM usage.


Constructor Summary
MemoryModel()
           
 
Method Summary
abstract  int getArraySize()
           
abstract  int getClassSize()
           
abstract  int getPrimitiveSize(Class<?> clazz)
           
abstract  int getReferenceSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryModel

public MemoryModel()
Method Detail

getArraySize

public abstract int getArraySize()
Returns:
size of array beyond contents

getClassSize

public abstract int getClassSize()
Returns:
Class size overhead

getPrimitiveSize

public abstract int getPrimitiveSize(Class<?> clazz)
Parameters:
clazz - a primitive Class - bool, byte, char, short, long, float, short, double, int
Returns:
the size in bytes of given primitive Class

getReferenceSize

public abstract int getReferenceSize()
Returns:
size of reference


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.