anthill.types
Interface Closeness

All Known Subinterfaces:
HashedKeyword
All Known Implementing Classes:
SHADigest, SHAHashedKeyword, SimpleHashedKeyword

public interface Closeness

Interface Closeness is implemented by objects whose content can be compared against two other objects for closeness.

Version:
$Revision: 1.1 $
Author:
Hein Meling

Method Summary
 int isCloser(Object x, Object y)
          Compares this object against the provided objects for closeness.
 

Method Detail

isCloser

public int isCloser(Object x,
                    Object y)
Compares this object against the provided objects for closeness. An implementation of this method must return an int according to the following rules:
    -1 is returned if the value of x is considered closer to this object than the value of y.
    +1 is returned if the value of y is considered closer to this object than the value of x.
     0 is returned if the values of x and y are equally close to this object.