Package elki.data

Class HyperBoundingBox

    • Field Summary

      Fields 
      Modifier and Type Field 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Serial version.
        See Also:
        Constant Field Values
      • min

        double[] min
        The coordinates of the 'lower left' (= minimum) hyper point.
      • max

        double[] max
        The coordinates of the 'upper right' (= maximum) hyper point.
    • Constructor Detail

      • HyperBoundingBox

        public HyperBoundingBox()
        Empty constructor for Externalizable interface.
      • HyperBoundingBox

        public HyperBoundingBox​(double[] min,
                                double[] max)
        Creates a HyperBoundingBox for the given hyper points.
        Parameters:
        min - - the coordinates of the minimum hyper point
        max - - the coordinates of the maximum hyper point
      • HyperBoundingBox

        public HyperBoundingBox​(SpatialComparable other)
        Constructor, cloning an existing spatial object.
        Parameters:
        other - Object to clone
    • Method Detail

      • getMin

        public double getMin​(int dimension)
        Returns the coordinate at the specified dimension of the minimum hyper point.
        Specified by:
        getMin in interface SpatialComparable
        Parameters:
        dimension - the dimension for which the coordinate should be returned, where 0 ≤ dimension < this.getDimensionality()
        Returns:
        the coordinate at the specified dimension of the minimum hyper point
      • getMax

        public double getMax​(int dimension)
        Returns the coordinate at the specified dimension of the maximum hyper point.
        Specified by:
        getMax in interface SpatialComparable
        Parameters:
        dimension - the dimension for which the coordinate should be returned, where 0 ≤ dimension < this.getDimensionality()
        Returns:
        the coordinate at the specified dimension of the maximum hyper point
      • getDimensionality

        public int getDimensionality()
        Returns the dimensionality of this HyperBoundingBox.
        Specified by:
        getDimensionality in interface SpatialComparable
        Returns:
        the dimensionality of this HyperBoundingBox
      • toString

        public java.lang.String toString()
        Returns a String representation of the HyperBoundingBox.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this hyper bounding box
      • toString

        public java.lang.String toString​(java.lang.String pre,
                                         java.text.NumberFormat nf)
        Returns a String representation of the HyperBoundingBox.
        Parameters:
        nf - number format for output accuracy
        pre - the prefix of each line
        Returns:
        a string representation of this hyper bounding box
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        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.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Parameters:
        out - the stream to write the object to
        Throws:
        java.io.IOException - Includes any I/O exceptions that may occur
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException
        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. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.
        Specified by:
        readExternal in interface java.io.Externalizable
        Parameters:
        in - the stream to read data from in order to restore the object
        Throws:
        java.io.IOException - if I/O errors occur