add --shared
[pylucene.git] / lucene-java-3.4.0 / lucene / src / java / org / apache / lucene / util / MemoryModel.java
1 package org.apache.lucene.util;
2
3 /**
4  * Licensed to the Apache Software Foundation (ASF) under one or more
5  * contributor license agreements. See the NOTICE file distributed with this
6  * work for additional information regarding copyright ownership. The ASF
7  * licenses this file to You under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  * http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16  * License for the specific language governing permissions and limitations under
17  * the License.
18  */
19
20 /**
21  * Returns primitive memory sizes for estimating RAM usage.
22  * 
23  */
24 public abstract class MemoryModel {
25
26   /**
27    * @return size of array beyond contents
28    */
29   public abstract int getArraySize();
30
31   /**
32    * @return Class size overhead
33    */
34   public abstract int getClassSize();
35
36   /**
37    * @param clazz a primitive Class - bool, byte, char, short, long, float,
38    *        short, double, int
39    * @return the size in bytes of given primitive Class
40    */
41   public abstract int getPrimitiveSize(Class<?> clazz);
42
43   /**
44    * @return size of reference
45    */
46   public abstract int getReferenceSize();
47
48 }