ostore.introspect
Class SimpleRealTime.Distance

java.lang.Object
  |
  +--ostore.introspect.SimpleRealTime.Distance
All Implemented Interfaces:
Comparable, Distance, QuickSerializable
Enclosing class:
SimpleRealTime

public static class SimpleRealTime.Distance
extends Object
implements Distance

Metric distance between two SimpleRealTimes.

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

Nested Class Summary
 
Nested classes inherited from class ostore.introspect.Distance
Distance.InfiniteDistance
 
Field Summary
 
Fields inherited from interface ostore.introspect.Distance
INFINITY
 
Constructor Summary
SimpleRealTime.Distance(double val)
          Constructor
SimpleRealTime.Distance(InputBuffer buffer)
           
 
Method Summary
 int compareTo(Object other)
           
 Distance difference(Distance other)
           
 boolean equals(Object other)
           
 double getValue()
          Get the value of this distance as a double
 Distance pow(int power)
           
 Distance scale(double factor)
           
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 Distance sum(Distance other)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleRealTime.Distance

public SimpleRealTime.Distance(double val)
Constructor


SimpleRealTime.Distance

public SimpleRealTime.Distance(InputBuffer buffer)
                        throws QSException
Method Detail

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Parameters:
buffer - the output buffer to add the object to

equals

public boolean equals(Object other)
Specified by:
equals in interface Distance
Overrides:
equals in class Object
Returns:
this == other

sum

public Distance sum(Distance other)
Specified by:
sum in interface Distance
Returns:
this + other

difference

public Distance difference(Distance other)
Specified by:
difference in interface Distance
Returns:
this - other

pow

public Distance pow(int power)
Specified by:
pow in interface Distance
Returns:
this^pow

scale

public Distance scale(double factor)
Specified by:
scale in interface Distance
Returns:
factor * this

compareTo

public int compareTo(Object other)
Specified by:
compareTo in interface Comparable

getValue

public double getValue()
Get the value of this distance as a double


toString

public String toString()
Overrides:
toString in class Object