viper.comparison.distances
Class DistanceHolder

java.lang.Object
  extended byviper.comparison.distances.DistanceHolder
All Implemented Interfaces:
java.lang.Cloneable

public class DistanceHolder
extends java.lang.Object
implements java.lang.Cloneable


Constructor Summary
DistanceHolder()
          Creates a new instance of DistanceHolder.
 
Method Summary
 java.lang.Object clone()
           
 double get(long i)
          Gets the distance at the given frame.
 double getAverage()
          Gets the average statistic.
 double getMaximum()
          Gets the max distance.
 double getMedian()
          Gets the median statistic.
 double getMinimum()
          Gets the minimum distance.
 double getStat(int stat)
          Gets the specified statistic.
 void set(long start, long end, double value)
          Sets the value for the given range.
 java.lang.String toString()
          Gets a space-delimited list of the distances.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DistanceHolder

public DistanceHolder()
Creates a new instance of DistanceHolder.

Method Detail

toString

public java.lang.String toString()
Gets a space-delimited list of the distances.

Returns:
the distances, so far

clone

public java.lang.Object clone()

getStat

public double getStat(int stat)
Gets the specified statistic.

Parameters:
stat - a statistic, e.g. Distances.MEAN
Returns:
the value of the specified statistic

getAverage

public double getAverage()
Gets the average statistic.

Returns:
the mean

getMedian

public double getMedian()
Gets the median statistic.

Returns:
the median

getMaximum

public double getMaximum()
Gets the max distance.

Returns:
the maximum

getMinimum

public double getMinimum()
Gets the minimum distance.

Returns:
the minimum

set

public void set(long start,
                long end,
                double value)
Sets the value for the given range.

Parameters:
start - the first instant
end - the end instant
value - the distance value
Throws:
java.lang.IllegalArgumentException - if start is not less than end

get

public double get(long i)
Gets the distance at the given frame.

Parameters:
i - the frame
Returns:
the distance value
Throws:
java.lang.IndexOutOfBoundsException - if the value is not set