Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.

1 /*2 3 This software is OSI Certified Open Source Software.4 OSI Certified is a certification mark of the Open Source Initiative.5 6 The license (Mozilla version 1.0) can be read at the MMBase site.7 See http://www.MMBase.org/license8 9 */10 package org.mmbase.util;11 12 /**13 * <p>14 * The {@link SizeOf} class tries to determine the size of memory structures.15 * This is tried by reflection and so on, but if an object is16 * 'SizeMeasurable' then it is asked to the object directly.17 *</p>18 *<p>19 * So, if your object stores its bulk in private members, and you want20 * its size to be determined adequately, then you should let it21 * implement this interface.22 *</p>23 *<p>24 * If you did not implement a class yourself, but have a clue how to25 * guess the size anyhow, then you could also put this implementation26 * in SizeOf itself (as for example was done for String). The27 * disadvantage of this approach is of course that you don't have28 * access to private members.29 *</p>30 * @author Michiel Meeuwissen31 * @since MMBase-1.632 * @version $Id: SizeMeasurable.java,v 1.4 2005/05/20 09:02:54 michiel Exp $33 */34 publicinterface SizeMeasurable {35 /**36 * Determines the byte-size of this object37 */38 publicint getByteSize();39 40 /**41 * Determines the byte-size of this object using the given SizeOf instance.42 * A SizeOf instance stores a Set already counted objects. So this method is typically called by SizeOf itself (recursion).43 */44 publicint getByteSize(SizeOf sizeof);45 }46