|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.fennel.tuple.FennelAttributeAccessor
public abstract class FennelAttributeAccessor
FennelAttributeAccessor defines how to efficiently unmarshal the value of an attribute from a stored tuple. Derived classes implement various strategies depending on the storage type.
All data members are defined at this level rather than in derived classes, which only provide method implementations. This makes it possible to write non-polymorphic access code in cases where the entire tuple is being processed, but polymorphic access code in cases where only a small subset of the attributes are being processed. In theory, this hybrid should yield the highest efficiency, but it needs to be benchmarked and tuned. This class is JDK 1.4 compatible.
Nested Class Summary | |
---|---|
static class |
FennelAttributeAccessor.FennelBitAccessor
marshalls a numeric bit |
static class |
FennelAttributeAccessor.FennelByteAccessor
marshalls a numeric byte (signed or unsigned) |
static class |
FennelAttributeAccessor.FennelFixedWidthAccessor
marshalls fixed-width byte arrays. |
static class |
FennelAttributeAccessor.FennelIntAccessor
marshalls a numeric int (signed or unsigned) |
static class |
FennelAttributeAccessor.FennelLongAccessor
marshalls a numeric long (signed or unsigned) |
static class |
FennelAttributeAccessor.FennelShortAccessor
marshalls a numeric short (signed or unsigned) |
static class |
FennelAttributeAccessor.FennelVarWidthAccessor
marshalls any variable width accessor, either first or subsequent. |
Field Summary | |
---|---|
int |
capacity
Copied from FennelTupleAttributeDescriptor.storageSize. |
int |
endIndirectOffset
Indirect offset of the end of this attribute within a stored tuple image, or Integer.MAX_VALUE if the end is fixed. |
int |
fixedOffset
Byte offset of this attribute within a stored tuple image, or Integer.MAX_VALUE if the start is variable. |
protected byte |
nullableBitMask
pre-computed offsets and masks for testing bit fields. |
protected int |
nullableBitOffset
pre-computed offsets and masks for testing bit fields. |
int |
nullBitNdx
Index of this attribute's null indicator bit in the tuple's bit array, or Integer.MAX_VALUE for a NOT NULL attribute. |
protected byte |
valueBitMask
pre-computed offsets and masks for testing bit fields. |
int |
valueBitNdx
Index of this attribute's value in the tuple's bit array, or Integer.MAX_VALUE for a non-bit attribute. |
protected int |
valueBitOffset
pre-computed offsets and masks for testing bit fields. |
Constructor Summary | |
---|---|
protected |
FennelAttributeAccessor()
|
Method Summary | |
---|---|
void |
computeBitAccessors(int bitfieldOffset)
computes bit accessors. |
boolean |
isPresent(ByteBuffer buf)
tests if a field is present in a tuple buffer. |
abstract void |
marshalValueData(ByteBuffer pDestData,
FennelTupleDatum value)
Marshalls value data for the attribute. |
void |
setPresent(ByteBuffer buf,
boolean isPresent)
sets the presence of a field in a tuple buffer. |
abstract void |
unmarshalValue(FennelTupleAccessor tupleAccessor,
FennelTupleDatum value)
Unmarshalls the attribute's value into a tupledatum holder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int nullBitNdx
public int fixedOffset
public int endIndirectOffset
public int valueBitNdx
public int capacity
protected int valueBitOffset
protected byte valueBitMask
protected int nullableBitOffset
protected byte nullableBitMask
Constructor Detail |
---|
protected FennelAttributeAccessor()
Method Detail |
---|
public void computeBitAccessors(int bitfieldOffset)
public boolean isPresent(ByteBuffer buf)
public void setPresent(ByteBuffer buf, boolean isPresent)
public abstract void unmarshalValue(FennelTupleAccessor tupleAccessor, FennelTupleDatum value)
tupleAccessor
- containing FennelTupleAccessor set up with the
current tuple image to be accessedvalue
- receives the reference to the unmarshalled valuepublic abstract void marshalValueData(ByteBuffer pDestData, FennelTupleDatum value)
pDestData
- the target address where the data should be marshalledvalue
- the value to be marshalled
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |