Class BufferLong

  • All Implemented Interfaces:
    java.io.Serializable

    public class BufferLong
    extends BufferBase
    This class extends the abstract BufferBase class. It allocates the space for a long buffer on construction. This class also defines the accessors to the data as required by the abstract base class.
    Version:
    0.1 Sept 1, 1997
    Author:
    Matthew J. McAuliffe, Ph.D.
    See Also:
    BufferBase, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long[] dataArray
      1D Data array of longs.
      private static long serialVersionUID
      Use serialVersionUID for interoperability.
    • Constructor Summary

      Constructors 
      Constructor Description
      BufferLong()
      Default constructor.
      BufferLong​(int size)
      Constructor that allocates memory.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void finalize()
      Clean up memory.
      protected java.lang.Number get​(int position)
      Gets the data in as a Number object.
      protected boolean getBoolean​(int position)
      Gets the data from the object as a boolean.
      protected byte getByte​(int position)
      Gets the data in byte format.
      protected double getDouble​(int position)
      Gets the data in double format.
      protected float getFloat​(int position)
      Gets the data in float format.
      protected int getInt​(int position)
      Gets the data in int format.
      protected long getLong​(int position)
      Gets the data in long format.
      protected short getShort​(int position)
      Gets the data in short format.
      protected java.lang.Class<?> getType()
      Return long.class
      protected short getUByte​(int position)
      Gets the data in short format.
      protected long getUInt​(int position)
      Gets the data in long format.
      protected int getUShort​(int position)
      Gets the data in unsigned short format.
      int length()
      Returns the length of the data array.
      protected void set​(int position, long value)
      Sets the value in long format.
      protected void set​(int position, java.lang.Number value)
      Sets the Number object in long format.
      protected void setBoolean​(int position, boolean value)
      Sets the long in byte format.
      protected void setByte​(int position, byte value)
      Sets the value in long format.
      protected void setDouble​(int position, double value)
      Sets the value in long format.
      protected void setFloat​(int position, float value)
      Sets the value in long format.
      protected void setInt​(int position, int value)
      Sets the value in long format.
      protected void setLong​(int position, long value)
      Sets the value in long format.
      protected void setShort​(int position, short value)
      Sets the value in long format.
      protected void setUByte​(int position, short value)
      Sets the value in long format.
      protected void setUInt​(int position, long value)
      Sets the int value in unsigned short format.
      protected void setUShort​(int position, int value)
      Sets the value in long format.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • dataArray

        protected long[] dataArray
        1D Data array of longs.
    • Constructor Detail

      • BufferLong

        public BufferLong()
        Default constructor.
      • BufferLong

        public BufferLong​(int size)
        Constructor that allocates memory.
        Parameters:
        size - the amount of data to allocate
    • Method Detail

      • getType

        protected final java.lang.Class<?> getType()
        Return long.class
        Specified by:
        getType in class BufferBase
        Returns:
        one of the primitive class objects, like float.class (== Float.TYPE)
      • finalize

        public void finalize()
                      throws java.lang.Throwable
        Clean up memory.
        Specified by:
        finalize in class BufferBase
        Throws:
        java.lang.Throwable - DOCUMENT ME!
      • length

        public int length()
        Returns the length of the data array.
        Specified by:
        length in class BufferBase
        Returns:
        length of the array
      • get

        protected final java.lang.Number get​(int position)
        Gets the data in as a Number object.
        Specified by:
        get in class BufferBase
        Parameters:
        position - position in dataArray
        Returns:
        Number object of the data
      • getBoolean

        protected final boolean getBoolean​(int position)
        Gets the data from the object as a boolean.
        Specified by:
        getBoolean in class BufferBase
        Parameters:
        position - position in dataArray to get
        Returns:
        true if data at position is not equal to zero else its false
      • getByte

        protected final byte getByte​(int position)
        Gets the data in byte format.
        Specified by:
        getByte in class BufferBase
        Parameters:
        position - position in dataArray
        Returns:
        the long value as a byte
      • getDouble

        protected final double getDouble​(int position)
        Gets the data in double format.
        Specified by:
        getDouble in class BufferBase
        Parameters:
        position - position in dataArray
        Returns:
        long value as a double
      • getFloat

        protected final float getFloat​(int position)
        Gets the data in float format.
        Specified by:
        getFloat in class BufferBase
        Parameters:
        position - position in dataArray
        Returns:
        long value as a float
      • getInt

        protected final int getInt​(int position)
        Gets the data in int format.
        Specified by:
        getInt in class BufferBase
        Parameters:
        position - position in dataArray
        Returns:
        long value as an int
      • getLong

        protected final long getLong​(int position)
        Gets the data in long format.
        Specified by:
        getLong in class BufferBase
        Parameters:
        position - position in dataArray
        Returns:
        long value as a long
      • getShort

        protected final short getShort​(int position)
        Gets the data in short format.
        Specified by:
        getShort in class BufferBase
        Parameters:
        position - position in dataArray
        Returns:
        long value as a short
      • getUByte

        protected final short getUByte​(int position)
        Gets the data in short format.
        Specified by:
        getUByte in class BufferBase
        Parameters:
        position - position in dataArray
        Returns:
        the long value as a short (unsigned byte)
      • getUInt

        protected final long getUInt​(int position)
        Gets the data in long format.
        Specified by:
        getUInt in class BufferBase
        Parameters:
        position - position in dataArray
        Returns:
        long value as a long
      • getUShort

        protected final int getUShort​(int position)
        Gets the data in unsigned short format.
        Specified by:
        getUShort in class BufferBase
        Parameters:
        position - position in dataArray
        Returns:
        long value as an int
      • set

        protected final void set​(int position,
                                 java.lang.Number value)
        Sets the Number object in long format.
        Specified by:
        set in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • set

        protected final void set​(int position,
                                 long value)
        Sets the value in long format.
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • setBoolean

        protected final void setBoolean​(int position,
                                        boolean value)
        Sets the long in byte format. One if value is true, zero if value is false
        Specified by:
        setBoolean in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • setByte

        protected final void setByte​(int position,
                                     byte value)
        Sets the value in long format.
        Specified by:
        setByte in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • setDouble

        protected final void setDouble​(int position,
                                       double value)
        Sets the value in long format.
        Specified by:
        setDouble in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • setFloat

        protected final void setFloat​(int position,
                                      float value)
        Sets the value in long format.
        Specified by:
        setFloat in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • setInt

        protected final void setInt​(int position,
                                    int value)
        Sets the value in long format.
        Specified by:
        setInt in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • setLong

        protected final void setLong​(int position,
                                     long value)
        Sets the value in long format.
        Specified by:
        setLong in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • setShort

        protected final void setShort​(int position,
                                      short value)
        Sets the value in long format.
        Specified by:
        setShort in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • setUByte

        protected final void setUByte​(int position,
                                      short value)
        Sets the value in long format.
        Specified by:
        setUByte in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • setUInt

        protected final void setUInt​(int position,
                                     long value)
        Sets the int value in unsigned short format.
        Specified by:
        setUInt in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array
      • setUShort

        protected final void setUShort​(int position,
                                       int value)
        Sets the value in long format.
        Specified by:
        setUShort in class BufferBase
        Parameters:
        position - position in dataArray
        value - the new data value to be placed in the data array