public class HyperBoundingBox extends java.lang.Object implements SpatialComparable, java.io.Externalizable
Modifier and Type | Field and Description |
---|---|
(package private) double[] |
max
The coordinates of the 'upper right' (= maximum) hyper point.
|
(package private) double[] |
min
The coordinates of the 'lower left' (= minimum) hyper point.
|
private static long |
serialVersionUID
Serial version.
|
Constructor and Description |
---|
HyperBoundingBox()
Empty constructor for Externalizable interface.
|
HyperBoundingBox(double[] min,
double[] max)
Creates a HyperBoundingBox for the given hyper points.
|
HyperBoundingBox(SpatialComparable other)
Constructor, cloning an existing spatial object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
getDimensionality()
Returns the dimensionality of this HyperBoundingBox.
|
double |
getMax(int dimension)
Returns the coordinate at the specified dimension of the maximum hyper
point.
|
double |
getMin(int dimension)
Returns the coordinate at the specified dimension of the minimum hyper
point.
|
int |
hashCode() |
void |
readExternal(java.io.ObjectInput in)
The object implements the readExternal method to restore its contents by
calling the methods of DataInput for primitive types and readObject for
objects, strings and arrays.
|
java.lang.String |
toString()
Returns a String representation of the HyperBoundingBox.
|
java.lang.String |
toString(java.lang.String pre,
java.text.NumberFormat nf)
Returns a String representation of the HyperBoundingBox.
|
void |
writeExternal(java.io.ObjectOutput out)
The object implements the writeExternal method to save its contents by
calling the methods of DataOutput for its primitive values or calling the
writeObject method of ObjectOutput for objects, strings, and arrays.
|
private static final long serialVersionUID
double[] min
double[] max
public HyperBoundingBox()
public HyperBoundingBox(double[] min, double[] max)
min
- - the coordinates of the minimum hyper pointmax
- - the coordinates of the maximum hyper pointpublic HyperBoundingBox(SpatialComparable other)
other
- Object to clonepublic double getMin(int dimension)
getMin
in interface SpatialComparable
dimension
- the dimension for which the coordinate should be returned,
where 0 ≤ dimension < this.getDimensionality()
public double getMax(int dimension)
getMax
in interface SpatialComparable
dimension
- the dimension for which the coordinate should be returned,
where 0 ≤ dimension < this.getDimensionality()
public int getDimensionality()
getDimensionality
in interface SpatialComparable
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String pre, java.text.NumberFormat nf)
nf
- number format for output accuracypre
- the prefix of each linepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- the stream to write the object tojava.io.IOException
- Includes any I/O exceptions that may occurpublic void readExternal(java.io.ObjectInput in) throws java.io.IOException
readExternal
in interface java.io.Externalizable
in
- the stream to read data from in order to restore the objectjava.io.IOException
- if I/O errors occurCopyright © 2019 ELKI Development Team. License information.