Class SpatialPointLeafEntry

    • Field Detail

      • serialVersionUID

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

        private DBID id
        Holds the id of the object (node or data object) represented by this entry.
      • values

        private double[] values
        The values of the underlying data object.
    • Constructor Detail

      • SpatialPointLeafEntry

        public SpatialPointLeafEntry()
        Empty constructor for serialization purposes.
      • SpatialPointLeafEntry

        public SpatialPointLeafEntry​(DBID id,
                                     double[] values)
        Constructs a new LeafEntry object with the given parameters.
        Parameters:
        id - the unique id of the underlying data object
        values - the values of the underlying data object
      • SpatialPointLeafEntry

        public SpatialPointLeafEntry​(DBID id,
                                     NumberVector vector)
        Constructor from number vector.
        Parameters:
        id - Object id
        vector - Number vector
    • Method Detail

      • getDBID

        public DBID getDBID()
        Description copied from interface: LeafEntry
        Get the DBID of this leaf entry.
        Specified by:
        getDBID in interface LeafEntry
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Calls the super method and writes the values of this entry to the specified stream.
        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,
                                 java.lang.ClassNotFoundException
        Calls the super method and reads the values of this entry from the specified input stream.
        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
        java.lang.ClassNotFoundException - If the class for an object being restored cannot be found.
      • doubleValue

        public double doubleValue​(int dimension)
        Description copied from interface: NumberVector
        Returns the value in the specified dimension as double.

        Note: this might seem redundant with respect to getValue(dim).doubleValue(), but usually this is much more efficient due to boxing/unboxing cost.

        Specified by:
        doubleValue in interface NumberVector
        Parameters:
        dimension - the desired dimension, where 0 ≤ dimension < this.getDimensionality()
        Returns:
        the value in the specified dimension
      • longValue

        public long longValue​(int dimension)
        Description copied from interface: NumberVector
        Returns the value in the specified dimension as long.

        Note: this might seem redundant with respect to getValue(dim).longValue(), but usually this is much more efficient due to boxing/unboxing cost.

        Specified by:
        longValue in interface NumberVector
        Parameters:
        dimension - the desired dimension, where 0 ≤ dimension < this.getDimensionality()
        Returns:
        the value in the specified dimension
      • toArray

        public double[] toArray()
        Description copied from interface: NumberVector
        Returns a double array copy of this vector.
        Specified by:
        toArray in interface NumberVector
        Returns:
        Copy as double[]
      • 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