Package gov.nih.mipav.model.structures
Class BufferBoolean
- java.lang.Object
-
- gov.nih.mipav.model.structures.BufferBase
-
- gov.nih.mipav.model.structures.BufferBoolean
-
- All Implemented Interfaces:
java.io.Serializable
public class BufferBoolean extends BufferBase
This class extends the abstract BufferBase class. It allocates the space for a boolean buffer on construction.- Version:
- 0.1 Aug 1, 1997
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
BufferBase
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.BitSet
dataArray
1D Data array of boolean stored in the BitSet object.private static long
serialVersionUID
Use serialVersionUID for interoperability.
-
Constructor Summary
Constructors Constructor Description BufferBoolean()
Default constructor.BufferBoolean(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 byte format.protected boolean
getBoolean(int position)
Gets the data from the object.protected byte
getByte(int position)
Gets the data in byte format.protected double
getDouble(int position)
Gets the acquire 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 byte.class, type returned by get()protected short
getUByte(int position)
Gets the data in byte format.protected long
getUInt(int position)
Gets the data in int 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, boolean value)
Sets the value in byte format.protected void
set(int position, java.lang.Number value)
Sets the value in boolean format.protected void
setBoolean(int position, boolean value)
Sets the value in boolean format.protected void
setByte(int position, byte value)
Sets the value in boolean format.protected void
setDouble(int position, double value)
Sets the value in boolean format.protected void
setFloat(int position, float value)
Sets the value in boolean format.protected void
setInt(int position, int value)
Sets the value in boolean format.protected void
setLong(int position, long value)
Sets the value in boolean format.protected void
setShort(int position, short value)
Sets the value in boolean format.protected void
setUByte(int position, short value)
Sets the value in unsigned byte format.protected void
setUInt(int position, long value)
Sets the value in boolean format.protected void
setUShort(int position, int value)
Sets the value in byte format.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
dataArray
protected java.util.BitSet dataArray
1D Data array of boolean stored in the BitSet object.
-
-
Method Detail
-
finalize
public void finalize() throws java.lang.Throwable
Clean up memory.- Specified by:
finalize
in classBufferBase
- Throws:
java.lang.Throwable
- DOCUMENT ME!
-
length
public int length()
Returns the length of the data array.- Specified by:
length
in classBufferBase
- Returns:
- length of the array
-
getType
protected final java.lang.Class<?> getType()
Return byte.class, type returned by get()- Specified by:
getType
in classBufferBase
- Returns:
- one of the primitive class objects, like float.class (== Float.TYPE)
-
get
protected final java.lang.Number get(int position)
Gets the data in byte format.- Specified by:
get
in classBufferBase
- Parameters:
position
- position in dataArray- Returns:
- Number object of the data
-
getBoolean
protected final boolean getBoolean(int position)
Gets the data from the object.- Specified by:
getBoolean
in classBufferBase
- Parameters:
position
- position in dataArray to get- Returns:
- the value returned as a boolean
-
getByte
protected final byte getByte(int position)
Gets the data in byte format.- Specified by:
getByte
in classBufferBase
- Parameters:
position
- position in dataArray- Returns:
- if true return 1 as a byte else return 0
-
getDouble
protected final double getDouble(int position)
Gets the acquire data in double format.- Specified by:
getDouble
in classBufferBase
- Parameters:
position
- position in dataArray- Returns:
- if true return 1 as a double else return 0
-
getFloat
protected final float getFloat(int position)
Gets the data in float format.- Specified by:
getFloat
in classBufferBase
- Parameters:
position
- position in dataArray- Returns:
- if true return 1 as a float else return 0
-
getInt
protected final int getInt(int position)
Gets the data in int format.- Specified by:
getInt
in classBufferBase
- Parameters:
position
- position in dataArray- Returns:
- if true return 1 as a int else return 0
-
getLong
protected final long getLong(int position)
Gets the data in long format.- Specified by:
getLong
in classBufferBase
- Parameters:
position
- position in dataArray- Returns:
- if true return 1 as a long else return 0
-
getShort
protected final short getShort(int position)
Gets the data in short format.- Specified by:
getShort
in classBufferBase
- Parameters:
position
- position in dataArray- Returns:
- if true return 1 as a short else return 0
-
getUByte
protected final short getUByte(int position)
Gets the data in byte format.- Specified by:
getUByte
in classBufferBase
- Parameters:
position
- position in dataArray- Returns:
- if true return 1 as a short else return 0
-
getUInt
protected final long getUInt(int position)
Gets the data in int format.- Specified by:
getUInt
in classBufferBase
- Parameters:
position
- position in dataArray- Returns:
- if true return 1 as a int else return 0
-
getUShort
protected final int getUShort(int position)
Gets the data in unsigned short format.- Specified by:
getUShort
in classBufferBase
- Parameters:
position
- position in dataArray- Returns:
- if true return 1 as a int else return 0
-
set
protected final void set(int position, java.lang.Number value)
Sets the value in boolean format.- Specified by:
set
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
set
protected final void set(int position, boolean value)
Sets the value in byte format.- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
setBoolean
protected final void setBoolean(int position, boolean value)
Sets the value in boolean format.- Specified by:
setBoolean
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
setByte
protected final void setByte(int position, byte value)
Sets the value in boolean format.- Specified by:
setByte
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
setDouble
protected final void setDouble(int position, double value)
Sets the value in boolean format.- Specified by:
setDouble
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
setFloat
protected final void setFloat(int position, float value)
Sets the value in boolean format.- Specified by:
setFloat
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
setInt
protected final void setInt(int position, int value)
Sets the value in boolean format.- Specified by:
setInt
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
setLong
protected final void setLong(int position, long value)
Sets the value in boolean format.- Specified by:
setLong
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
setShort
protected final void setShort(int position, short value)
Sets the value in boolean format.- Specified by:
setShort
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
setUByte
protected final void setUByte(int position, short value)
Sets the value in unsigned byte format.- Specified by:
setUByte
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
setUInt
protected final void setUInt(int position, long value)
Sets the value in boolean format.- Specified by:
setUInt
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
setUShort
protected final void setUShort(int position, int value)
Sets the value in byte format.- Specified by:
setUShort
in classBufferBase
- Parameters:
position
- position in dataArrayvalue
- the new data value to be placed in the data array
-
-