public class ArrayHandler extends java.lang.Object implements CascadingTypeHandler, Comparable4, ValueTypeHandler, VariableLengthTypeHandler, VersionedTypeHandler, QueryableTypeHandler
| Modifier and Type | Field and Description |
|---|---|
protected ArrayVersionHelper |
_versionHelper |
| Constructor and Description |
|---|
ArrayHandler() |
ArrayHandler(TypeHandler4 handler,
boolean usePrimitiveClassReflector) |
| Modifier and Type | Method and Description |
|---|---|
Iterator4 |
allElements(ObjectContainerBase container,
java.lang.Object a_object) |
static Iterator4 |
allElements(ReflectArray reflectArray,
java.lang.Object array) |
protected void |
analyze(ObjectContainerBase container,
java.lang.Object obj,
ArrayInfo info) |
protected void |
analyzeDimensions(ObjectContainerBase container,
java.lang.Object obj,
ArrayInfo info) |
protected ReflectArray |
arrayReflector(ObjectContainerBase container) |
void |
cascadeActivation(ActivationContext context)
will be called during activation if the handled
object is already active
|
protected int |
classIDFromInfo(ObjectContainerBase container,
ArrayInfo info) |
int |
classIdToMarshalledClassId(int classID,
boolean primitive) |
protected ReflectClass |
classReflector(Reflector reflector,
ClassMetadata classMetadata,
boolean isPrimitive) |
void |
collectIDs(QueryingReadContext context)
will be called during querying to ask for IDs of member
objects of the handled object.
|
protected ArrayVersionHelper |
createVersionHelper() |
java.lang.Object |
deepClone(java.lang.Object context)
The parameter allows passing one new object so parent
references can be corrected on children.
|
void |
defragment(DefragmentContext context)
gets called when an object gets defragmented.
|
void |
defragmentSlot(DefragmentContext context) |
TypeHandler4 |
delegateTypeHandler() |
void |
delete(DeleteContext context)
gets called when an object gets deleted.
|
void |
deletePrimitiveEmbedded(StatefulBuffer buffer,
PrimitiveTypeMetadata classPrimitive) |
boolean |
descendsIntoMembers() |
boolean |
equals(java.lang.Object obj) |
protected ArrayInfo |
forEachElement(AbstractBufferContext context,
java.lang.Runnable elementRunnable) |
protected boolean |
handleAsByteArray(BufferContext context) |
protected boolean |
handleAsByteArray(java.lang.Object obj) |
int |
hashCode() |
protected boolean |
hasNullBitmap(ArrayInfo info) |
byte |
identifier() |
protected boolean |
isPreVersion0Format(int elementCount) |
protected boolean |
isPrimitive(Reflector reflector,
ReflectClass claxx,
ClassMetadata classMetadata) |
static Iterator4 |
iterator(ReflectClass claxx,
java.lang.Object obj) |
int |
linkLength() |
protected ArrayInfo |
newArrayInfo() |
protected java.lang.Object |
newInstance(ReflectArray arrayReflector,
ArrayInfo info,
ReflectClass clazz) |
protected ReflectClass |
newInstanceReflectClass(Reflector reflector,
ArrayInfo info) |
protected BitMap4 |
nullItemsMap(ReflectArray reflector,
java.lang.Object array) |
PreparedComparison |
prepareComparison(Context context,
java.lang.Object obj)
creates a prepared comparison to compare multiple objects
against one single object.
|
ReflectClass |
primitiveClassReflector(Reflector reflector) |
java.lang.Object |
read(ReadContext context)
gets called when an value type is to be read from the database.
|
TypeHandler4 |
readCandidateHandler(QueryingReadContext context)
will be called during querying to ask for the handler
to be used to collect children of the handled object
|
protected java.lang.Object |
readCreate(Transaction trans,
ReadBuffer buffer,
ArrayInfo info) |
protected void |
readDimensions(ArrayInfo info,
ReadBuffer buffer) |
protected void |
readElements(ReadContext context,
ArrayInfo info,
java.lang.Object array) |
protected void |
readInfo(Transaction trans,
ReadBuffer buffer,
ArrayInfo info) |
protected void |
readInto(ReadContext context,
ArrayInfo info,
java.lang.Object array) |
protected BitMap4 |
readNullBitmap(ReadBuffer context,
int length) |
java.lang.String |
toString() |
TypeHandler4 |
unversionedTemplate() |
protected boolean |
useJavaHandling() |
protected void |
withContent(AbstractBufferContext context,
java.lang.Runnable runnable) |
void |
write(WriteContext context,
java.lang.Object obj)
gets called when an object is to be written to the database.
|
protected void |
writeDimensions(WriteContext context,
ArrayInfo info) |
protected void |
writeElements(WriteContext context,
java.lang.Object obj,
ArrayInfo info) |
protected void |
writeInfo(WriteContext context,
ArrayInfo info) |
protected final ArrayVersionHelper _versionHelper
public ArrayHandler()
public ArrayHandler(TypeHandler4 handler, boolean usePrimitiveClassReflector)
protected ArrayVersionHelper createVersionHelper()
protected ReflectArray arrayReflector(ObjectContainerBase container)
public Iterator4 allElements(ObjectContainerBase container, java.lang.Object a_object)
public static Iterator4 allElements(ReflectArray reflectArray, java.lang.Object array)
public final void cascadeActivation(ActivationContext context)
CascadingTypeHandlercascadeActivation in interface CascadingTypeHandlerpublic void collectIDs(QueryingReadContext context)
CascadingTypeHandlercollectIDs in interface CascadingTypeHandlerprotected ArrayInfo forEachElement(AbstractBufferContext context, java.lang.Runnable elementRunnable)
protected void withContent(AbstractBufferContext context, java.lang.Runnable runnable)
public void delete(DeleteContext context) throws Db4oIOException
TypeHandler4delete in interface TypeHandler4Db4oIOExceptionpublic final void deletePrimitiveEmbedded(StatefulBuffer buffer, PrimitiveTypeMetadata classPrimitive)
classPrimitive - public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectprotected boolean handleAsByteArray(java.lang.Object obj)
public byte identifier()
public ReflectClass primitiveClassReflector(Reflector reflector)
protected java.lang.Object readCreate(Transaction trans, ReadBuffer buffer, ArrayInfo info)
protected final java.lang.Object newInstance(ReflectArray arrayReflector, ArrayInfo info, ReflectClass clazz)
protected final ReflectClass newInstanceReflectClass(Reflector reflector, ArrayInfo info)
public TypeHandler4 readCandidateHandler(QueryingReadContext context)
CascadingTypeHandlerreadCandidateHandler in interface CascadingTypeHandlerprotected void readInfo(Transaction trans, ReadBuffer buffer, ArrayInfo info)
protected void readDimensions(ArrayInfo info, ReadBuffer buffer)
protected boolean isPreVersion0Format(int elementCount)
protected final ReflectClass classReflector(Reflector reflector, ClassMetadata classMetadata, boolean isPrimitive)
public static Iterator4 iterator(ReflectClass claxx, java.lang.Object obj)
protected boolean useJavaHandling()
protected int classIDFromInfo(ObjectContainerBase container, ArrayInfo info)
public final int classIdToMarshalledClassId(int classID,
boolean primitive)
protected final boolean isPrimitive(Reflector reflector, ReflectClass claxx, ClassMetadata classMetadata)
public void defragment(DefragmentContext context)
TypeHandler4defragment in interface TypeHandler4public final void defragmentSlot(DefragmentContext context)
protected boolean handleAsByteArray(BufferContext context)
public java.lang.Object read(ReadContext context)
ValueTypeHandlerread in interface ValueTypeHandlerprotected void readElements(ReadContext context, ArrayInfo info, java.lang.Object array)
protected ArrayInfo newArrayInfo()
protected final void readInto(ReadContext context, ArrayInfo info, java.lang.Object array)
protected BitMap4 readNullBitmap(ReadBuffer context, int length)
protected final boolean hasNullBitmap(ArrayInfo info)
public void write(WriteContext context, java.lang.Object obj)
TypeHandler4write in interface TypeHandler4obj - the objectprotected void writeElements(WriteContext context, java.lang.Object obj, ArrayInfo info)
protected void writeInfo(WriteContext context, ArrayInfo info)
protected void writeDimensions(WriteContext context, ArrayInfo info)
protected final void analyze(ObjectContainerBase container, java.lang.Object obj, ArrayInfo info)
protected void analyzeDimensions(ObjectContainerBase container, java.lang.Object obj, ArrayInfo info)
protected BitMap4 nullItemsMap(ReflectArray reflector, java.lang.Object array)
public PreparedComparison prepareComparison(Context context, java.lang.Object obj)
Comparable4prepareComparison in interface Comparable4context - the context of the comparisonobj - the object that is to be compared
against multiple other objectspublic int linkLength()
public TypeHandler4 unversionedTemplate()
unversionedTemplate in interface VersionedTypeHandlerpublic java.lang.Object deepClone(java.lang.Object context)
DeepClonepublic TypeHandler4 delegateTypeHandler()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean descendsIntoMembers()
descendsIntoMembers in interface QueryableTypeHandler