BooleanDataLayout

public interface BooleanDataLayout
Known Indirect Subclasses

A DataLayout that converts data stored in a buffer to booleans.

See Also

Public Methods

abstract BooleanDataBuffer
applyTo(S buffer)
Apply this layout to the provided buffer.
abstract boolean
readBoolean(S buffer, long index)
Reads n = scale() values from the buffer at the given index and return them as a boolean.
abstract Boolean
readObject(S buffer, long index)
Reads n = scale() values from the buffer at the given index and return them as a single value in the user type.
abstract void
writeBoolean(S buffer, boolean value, long index)
Writes a boolean into the buffer at the given index after converting it to the buffer type.
abstract void
writeObject(S buffer, Boolean value, long index)

Inherited Methods

Public Methods

public abstract BooleanDataBuffer applyTo (S buffer)

Apply this layout to the provided buffer.

The returned DataBuffer instance is simply a wrapper to the original buffer and does not have a backing storage of his own.

Parameters
buffer the target buffer to apply this layout to
Returns
  • a buffer with this layout

public abstract boolean readBoolean (S buffer, long index)

Reads n = scale() values from the buffer at the given index and return them as a boolean.

Parameters
buffer the buffer to read from
index position of the buffer to read in the buffer
Returns
  • the boolean value

public abstract Boolean readObject (S buffer, long index)

Reads n = scale() values from the buffer at the given index and return them as a single value in the user type.

It is the responsibility of the implementors of this interface to read the value to be converted from the given buffer, using the most appropriate method. For example, for a layout that converting a single long to a BigInteger,

 @Override
 public BigInteger readObject(LongDataBuffer buffer, long index) {
   return BigInteger.valueOf(buffer.getLong(index));
 }
 
If a single user value scales over more than one buffer values, index indicates the starting position of the sequence to be read from the buffer.

Parameters
buffer the buffer to read from
index position of the buffer to read in the buffer
Returns
  • the converted value

public abstract void writeBoolean (S buffer, boolean value, long index)

Writes a boolean into the buffer at the given index after converting it to the buffer type.

Parameters
buffer the buffer to write to
value the boolean to convert and write
index index in the buffer where the converted value should be written

public abstract void writeObject (S buffer, Boolean value, long index)