Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.index.tree.spatial
Class SpatialComparator

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialComparator
All Implemented Interfaces:
Comparator<SpatialComparable>

public final class SpatialComparator
extends Object
implements Comparator<SpatialComparable>

Compares objects of type SpatialComparable.

Author:
Elke Achtert

Field Summary
private  int compareDimension
          The dimension for comparison.
private  int comparisonValue
          Indicates the comparison value (min or max).
static int MAX
          Indicates the comparison of the max values of the entries' MBRs.
static int MIN
          Indicates the comparison of the min values of the entries' MBRs.
 
Constructor Summary
SpatialComparator(int compareDimension, int comparisonValue)
          Creates a new spatial comparator with the specified parameters.
 
Method Summary
 int compare(SpatialComparable o1, SpatialComparable o2)
          Compares the two specified spatial comparables according to the sorting dimension and the comparison value of this Comparator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

MIN

public static final int MIN
Indicates the comparison of the min values of the entries' MBRs.

See Also:
Constant Field Values

MAX

public static final int MAX
Indicates the comparison of the max values of the entries' MBRs.

See Also:
Constant Field Values

compareDimension

private final int compareDimension
The dimension for comparison.


comparisonValue

private final int comparisonValue
Indicates the comparison value (min or max).

Constructor Detail

SpatialComparator

public SpatialComparator(int compareDimension,
                         int comparisonValue)
Creates a new spatial comparator with the specified parameters.

Parameters:
compareDimension - the dimension to be set for comparison
comparisonValue - the comparison value to be set
Method Detail

compare

public int compare(SpatialComparable o1,
                   SpatialComparable o2)
Compares the two specified spatial comparables according to the sorting dimension and the comparison value of this Comparator.

Specified by:
compare in interface Comparator<SpatialComparable>
Parameters:
o1 - the first spatial comparable
o2 - the second spatial comparable
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Release 0.2 (2009-07-06_1820)