Package gov.nih.mipav.model.structures
Class BufferBase
- java.lang.Object
-
- gov.nih.mipav.model.structures.BufferBase
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
BufferBoolean,BufferByte,BufferDouble,BufferFloat,BufferInt,BufferLong,BufferShort,BufferUByte,BufferUInt,BufferUShort
public abstract class BufferBase extends java.lang.Object implements java.io.SerializableThis is an abstract buffer class that indicates the required methods of the sub-classes. This is a base class of a generic data "black box" - it supports all the native java data types.- Version:
- 0.1 Aug 1, 1997
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
BufferBoolean,BufferByte,BufferShort,BufferInt,BufferLong,BufferFloat,BufferDouble, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUIDUse serialVersionUID for interoperability.
-
Constructor Summary
Constructors Constructor Description BufferBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description protected abstract voidfinalize()Clean up memory.protected abstract java.lang.Numberget(int position)Gets a Number object at position in the data array.protected abstract booleangetBoolean(int position)Gets a boolean value at position in the data array.protected abstract bytegetByte(int position)Gets a byte value at position in the data array.protected abstract doublegetDouble(int position)Gets a double value at position in the data array.protected abstract floatgetFloat(int position)Gets a float value at position in the data array.protected abstract intgetInt(int position)Gets a int value at position in the data array.protected abstract longgetLong(int position)Gets a long value at position in the data array.protected abstract shortgetShort(int position)Gets a short value at position in the data array.protected abstract java.lang.Class<?>getType()Get the primitive type of the buffer.protected abstract shortgetUByte(int position)Gets a short value (unsigned byte[0:255]) at position in the data array.protected abstract longgetUInt(int position)Gets a long value (unsigned int) at position in the data array.protected abstract intgetUShort(int position)Gets a int value (unsigned short) at position in the data array.protected abstract intlength()Gets the length of the data array.protected abstract voidset(int position, java.lang.Number value)Sets the data array at the specified index to the specified value.protected abstract voidsetBoolean(int position, boolean value)Sets the data array at the specified index to the specified value.protected abstract voidsetByte(int position, byte value)Sets the data array at the specified index to the specified value.protected abstract voidsetDouble(int position, double value)Sets the data array at the specified index to the specified value.protected abstract voidsetFloat(int position, float value)Sets the data array at the specified index to the specified value.protected abstract voidsetInt(int position, int value)Sets the data array at the specified index to the specified value.protected abstract voidsetLong(int position, long value)Sets the data array at the specified index to the specified value.protected abstract voidsetShort(int position, short value)Sets the data array at the specified index to the specified value.protected abstract voidsetUByte(int position, short value)Sets the data array at the specified index to the specified value.protected abstract voidsetUInt(int position, long value)Sets the data array at the specified index to the specified value.protected abstract voidsetUShort(int position, int value)Sets the data array at the specified index to the specified value.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
-
Method Detail
-
finalize
protected abstract void finalize() throws java.lang.ThrowableClean up memory.- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable- indicates error in while finalizing.
-
getType
protected abstract java.lang.Class<?> getType()
Get the primitive type of the buffer.- Returns:
- one of the primitive class objects, like float.class (== Float.TYPE)
-
get
protected abstract java.lang.Number get(int position)
Gets a Number object at position in the data array.- Parameters:
position- index into the data array.- Returns:
- Number object of the data
-
getBoolean
protected abstract boolean getBoolean(int position)
Gets a boolean value at position in the data array.- Parameters:
position- index into the data array.- Returns:
- boolean value of the data
-
getByte
protected abstract byte getByte(int position)
Gets a byte value at position in the data array.- Parameters:
position- index into the data array.- Returns:
- byte value of the data
-
getDouble
protected abstract double getDouble(int position)
Gets a double value at position in the data array.- Parameters:
position- index into the data array.- Returns:
- double value of the data
-
getFloat
protected abstract float getFloat(int position)
Gets a float value at position in the data array.- Parameters:
position- index into the data array.- Returns:
- float value of the data
-
getInt
protected abstract int getInt(int position)
Gets a int value at position in the data array.- Parameters:
position- index into the data array.- Returns:
- int value of the data
-
getLong
protected abstract long getLong(int position)
Gets a long value at position in the data array.- Parameters:
position- index into the data array.- Returns:
- long value of the data
-
getShort
protected abstract short getShort(int position)
Gets a short value at position in the data array.- Parameters:
position- index into the data array.- Returns:
- short value of the data
-
getUByte
protected abstract short getUByte(int position)
Gets a short value (unsigned byte[0:255]) at position in the data array.- Parameters:
position- index into the data array.- Returns:
- short(unsigned byte[0:255]) value of the data
-
getUInt
protected abstract long getUInt(int position)
Gets a long value (unsigned int) at position in the data array.- Parameters:
position- index into the data array.- Returns:
- long(unsigned int) value of the data
-
getUShort
protected abstract int getUShort(int position)
Gets a int value (unsigned short) at position in the data array.- Parameters:
position- index into the data array.- Returns:
- int(unsigned short) value of the data
-
length
protected abstract int length()
Gets the length of the data array.- Returns:
- the length of the data array
-
set
protected abstract void set(int position, java.lang.Number value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
setBoolean
protected abstract void setBoolean(int position, boolean value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
setByte
protected abstract void setByte(int position, byte value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
setDouble
protected abstract void setDouble(int position, double value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
setFloat
protected abstract void setFloat(int position, float value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
setInt
protected abstract void setInt(int position, int value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
setLong
protected abstract void setLong(int position, long value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
setShort
protected abstract void setShort(int position, short value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
setUByte
protected abstract void setUByte(int position, short value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
setUInt
protected abstract void setUInt(int position, long value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
setUShort
protected abstract void setUShort(int position, int value)Sets the data array at the specified index to the specified value.- Parameters:
position- position in data arrayvalue- the new data value to be placed in the data array
-
-