Class ObjectDataType.DoubleType

    • Constructor Detail

      • DoubleType

        private DoubleType()
    • Method Detail

      • createStorage

        public java.lang.Double[] createStorage​(int size)
        Description copied from interface: DataType
        Create storage object of array type to hold values
        Parameters:
        size - number of values to hold
        Returns:
        storage object
      • compare

        public int compare​(java.lang.Double a,
                           java.lang.Double b)
        Description copied from interface: DataType
        Compare two keys.
        Specified by:
        compare in interface java.util.Comparator<java.lang.Double>
        Specified by:
        compare in interface DataType<java.lang.Double>
        Overrides:
        compare in class BasicDataType<java.lang.Double>
        Parameters:
        a - the first key
        b - the second key
        Returns:
        -1 if the first key is smaller, 1 if larger, and 0 if equal
      • getMemory

        public int getMemory​(java.lang.Double obj)
        Description copied from interface: DataType
        Calculates the amount of used memory in bytes.
        Specified by:
        getMemory in interface DataType<java.lang.Double>
        Overrides:
        getMemory in class ObjectDataType.AutoDetectDataType<java.lang.Double>
        Parameters:
        obj - the object
        Returns:
        the used memory
      • read

        public java.lang.Double read​(java.nio.ByteBuffer buff)
        Description copied from interface: DataType
        Read an object.
        Specified by:
        read in interface DataType<java.lang.Double>
        Specified by:
        read in class BasicDataType<java.lang.Double>
        Parameters:
        buff - the source buffer
        Returns:
        the object
      • read

        public java.lang.Double read​(java.nio.ByteBuffer buff,
                                     int tag)
        Description copied from class: ObjectDataType.AutoDetectDataType
        Read an object from the buffer.
        Specified by:
        read in class ObjectDataType.AutoDetectDataType<java.lang.Double>
        Parameters:
        buff - the buffer
        tag - the first byte of the object (usually the type)
        Returns:
        the read object