net.sf.ivmaidns.util
Interface Metricable

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
DNSRecAltCmp, StrComparator

public interface Metricable
extends 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.

Since:
2.0
Version:
2.0
Author:
Ivan Maidanski
See Also:
ToString, GComparator

Method Summary
 int evaluate(java.lang.Object obj)
          The body of the metrics.
 

Method Detail

evaluate

int evaluate(java.lang.Object obj)
The body of the metrics. Evaluates the supplied object. If the object is not instance of the expected type then 0 is always returned.

Parameters:
obj - the object (may be null) to evaluate.
Returns:
the integer result of the performed evaluation.