/* * @(#) Metricable.java - Interface for integer metrics adapters. * (c) 2000 Ivan Maidanski http://ivmai.chat.ru * Freeware class library sources. All rights reserved. ** * Language: Java [pure] * Tested with: JDK v1.1.6 * Last modified: 2000-12-27 14:25:00 GMT+03:00 */ /* * This software is the proprietary information of the author. ** * Permission to use, copy, and distribute this software and its * documentation for non-commercial purposes and without fee is * hereby granted provided that this copyright notice appears in all * copies. ** * This software should not be modified in any way; any found bug * should be reported to the author. ** * The author disclaims all warranties with regard to this software, * including all implied warranties of merchantability and fitness. * In no event shall the author be liable for any special, indirect * or consequential damages or any damages whatsoever resulting from * loss of use, data or profits, whether in an action of contract, * negligence or other tortuous action, arising out of or in * connection with the use or performance of this software. */ package ivmai.util; import java.io.Serializable; /** * Interface for integer metrics adapters. ** * This interface declares a custom function which may evaluate * (according to the semantics) an object value. Metrics may also * serve as a predicate (filter), just if a non-zero result is * interpreted as true. Metrics may be used in * serializable data structures since Serializable * interface is extended. ** * @see ToString * @see GComparator ** * @version 2.0 * @author Ivan Maidanski ** * @since 2.0 */ public interface Metricable extends Serializable { /** * The body of the metrics. ** * Evaluates the supplied object. If the object is not instance of * the expected type then 0 is always returned. ** * @param obj * the object (may be null) to evaluate. * @return * the integer result of the performed evaluation. */ public abstract int evaluate(Object obj); }