de.lmu.ifi.dbs.elki.data
Class Interval

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.data.Interval
All Implemented Interfaces:
Comparable<Interval>

public class Interval
extends Object
implements Comparable<Interval>

Represents an interval in a certain dimension of the data space.


Field Summary
private  int dimension
          The dimension of this interval in the (original) data space.
private  double max
          The maximum (right) value of this interval.
private  double min
          The minimum (left) value of this interval.
 
Constructor Summary
Interval(int dimension, double min, double max)
          Creates a new interval with the specified parameters.
 
Method Summary
 int compareTo(Interval other)
          Compares this interval with the specified interval for order.
 int getDimension()
          Returns the dimension of the interval in the original data space
 double getMax()
          Returns the maximum (right) value of the interval.
 double getMin()
          Returns the minimum (left) value of the interval.
 String toString()
          Returns a string representation of this interval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dimension

private int dimension
The dimension of this interval in the (original) data space.


min

private double min
The minimum (left) value of this interval.


max

private double max
The maximum (right) value of this interval.

Constructor Detail

Interval

public Interval(int dimension,
                double min,
                double max)
Creates a new interval with the specified parameters.

Parameters:
dimension - the dimension of the interval in the original data space
min - the minimum (left) value of the interval
max - the maximum (right) value of the interval
Method Detail

getDimension

public int getDimension()
Returns the dimension of the interval in the original data space

Returns:
the dimension of the interval in the original data space

getMin

public double getMin()
Returns the minimum (left) value of the interval.

Returns:
the minimum (left) value of the interval

getMax

public double getMax()
Returns the maximum (right) value of the interval.

Returns:
the maximum (right) value of the interval

toString

public String toString()
Returns a string representation of this interval. The string representation consists of the dimension and the min and max values of this interval.

Overrides:
toString in class Object
Returns:
a string representation of this interval

compareTo

public int compareTo(Interval other)
Compares this interval with the specified interval for order. Returns a negative integer, zero, or a positive integer as this interval is less than, equal to, or greater than the specified interval. First the dimensions of the intervals are compared. In case of equality the min (left) values are compared.

Specified by:
compareTo in interface Comparable<Interval>
Parameters:
other - the interval to be compared
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Release 0.4.0 (2011-09-20_1324)