Package org.postgresql.pljava.pg
Class TupleTableSlotImpl<L extends Datum.Layout>
java.lang.Object
org.postgresql.pljava.pg.TupleTableSlotImpl<L>
- All Implemented Interfaces:
TupleTableSlot
public abstract class TupleTableSlotImpl<L extends Datum.Layout>
extends Object
implements TupleTableSlot
Implementation of
TupleTableSlot
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.postgresql.pljava.model.TupleTableSlot
TupleTableSlot.Indexed
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Datum.Accessor<ByteBuffer,
L>[] protected final Adapter<?,
?>[] protected final ByteBuffer
protected final ByteBuffer
protected final TupleDescriptor
protected final ByteBuffer
-
Method Summary
Modifier and TypeMethodDescriptionprotected Datum.Accessor
<ByteBuffer, L> accessor
(int idx) Returns the previously-selectedAccessor
for the item at the given index.protected Attribute
Return theAttribute
at this index into the associatedTupleDescriptor
, ensuring the elements at that index ofm_accessors
andm_adapters
are set, or throw an exception if thisAttribute
doesn't belong to this slot'sTupleDescriptor
, or if the suppliedAdapter
can't fetch it.<T> T
get
(int idx, Adapter.As<T, ?> adapter) boolean
get
(int idx, Adapter.AsBoolean<?> adapter) byte
get
(int idx, Adapter.AsByte<?> adapter) char
get
(int idx, Adapter.AsChar<?> adapter) double
get
(int idx, Adapter.AsDouble<?> adapter) float
get
(int idx, Adapter.AsFloat<?> adapter) int
get
(int idx, Adapter.AsInt<?> adapter) long
get
(int idx, Adapter.AsLong<?> adapter) short
get
(int idx, Adapter.AsShort<?> adapter) <T> T
get
(Attribute att, Adapter.As<T, ?> adapter) boolean
get
(Attribute att, Adapter.AsBoolean<?> adapter) byte
get
(Attribute att, Adapter.AsByte<?> adapter) char
get
(Attribute att, Adapter.AsChar<?> adapter) double
get
(Attribute att, Adapter.AsDouble<?> adapter) float
get
(Attribute att, Adapter.AsFloat<?> adapter) int
get
(Attribute att, Adapter.AsInt<?> adapter) long
get
(Attribute att, Adapter.AsLong<?> adapter) short
get
(Attribute att, Adapter.AsShort<?> adapter) protected abstract boolean
isNull
(int idx) Only to be called after idx is known valid from callingtoIndex
.protected void
Called after verifying that att belongs to this slot'sTupleDescriptor
, that idx is its corresponding (zero-based) index, and thatm_adapters[idx]
does not already contain adp.relation()
protected abstract Datum.Accessor
<ByteBuffer, L> selectAccessor
(boolean byValue, short length) Selects appropriateAccessor
for thisLayout
given byValue and length.protected int
Return the index intom_accessors
for this attribute, ensuring the elements at that index ofm_accessors
andm_adapters
are set, or throw an exception if thisAttribute
doesn't belong to this slot'sTupleDescriptor
, or if the suppliedAdapter
can't fetch it.protected abstract int
toOffset
(int idx) Only to be called after idx is known valid from callingtoIndex
.
-
Field Details
-
m_tts
-
m_tupdesc
-
m_values
-
m_isnull
-
m_accessors
-
m_adapters
-
-
Method Details
-
toIndex
Return the index intom_accessors
for this attribute, ensuring the elements at that index ofm_accessors
andm_adapters
are set, or throw an exception if thisAttribute
doesn't belong to this slot'sTupleDescriptor
, or if the suppliedAdapter
can't fetch it.Most tests are skipped if the index is in range and
m_adapters
at that index already contains the suppliedAdapter
. -
fromIndex
Return theAttribute
at this index into the associatedTupleDescriptor
, ensuring the elements at that index ofm_accessors
andm_adapters
are set, or throw an exception if thisAttribute
doesn't belong to this slot'sTupleDescriptor
, or if the suppliedAdapter
can't fetch it.Most tests are skipped if the index is in range and
m_adapters
at that index already contains the suppliedAdapter
. -
memoize
Called after verifying that att belongs to this slot'sTupleDescriptor
, that idx is its corresponding (zero-based) index, and thatm_adapters[idx]
does not already contain adp. -
selectAccessor
Selects appropriateAccessor
for thisLayout
given byValue and length. -
accessor
Returns the previously-selectedAccessor
for the item at the given index.The indirection's cost may be regrettable, but it simplifies the implementation of
Indexed
. -
isNull
protected abstract boolean isNull(int idx) Only to be called after idx is known valid from callingtoIndex
. -
toOffset
protected abstract int toOffset(int idx) Only to be called after idx is known valid from callingtoIndex
. -
relation
- Specified by:
relation
in interfaceTupleTableSlot
-
descriptor
- Specified by:
descriptor
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-
get
- Specified by:
get
in interfaceTupleTableSlot
-