ostore.introspect
Interface Distance

All Superinterfaces:
Comparable, QuickSerializable
All Known Implementing Classes:
Distance.InfiniteDistance, SimpleRealTime.Distance

public interface Distance
extends Comparable, QuickSerializable

Semantic distance between two objects. Distances must be comparable. Subclasses must handle INFINITY distance correctly.

Version:
$Id: Distance.java,v 1.4 2003/04/03 01:10:22 jeffpang Exp $
Author:
Jeff Pang

Nested Class Summary
static class Distance.InfiniteDistance
          Special distance value representing infinity.
 
Field Summary
static Distance INFINITY
          Distance representing infinite distance.
 
Method Summary
 Distance difference(Distance other)
           
 boolean equals(Object other)
           
 Distance pow(int power)
           
 Distance scale(double factor)
           
 Distance sum(Distance other)
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface ostore.util.QuickSerializable
serialize
 

Field Detail

INFINITY

public static final Distance INFINITY
Distance representing infinite distance.

Method Detail

equals

public boolean equals(Object other)
Overrides:
equals in class Object
Returns:
this == other

sum

public Distance sum(Distance other)
Returns:
this + other

difference

public Distance difference(Distance other)
Returns:
this - other

pow

public Distance pow(int power)
Returns:
this^pow

scale

public Distance scale(double factor)
Returns:
factor * this