com.sleepycat.persist.impl
Class PrimitiveArrayFormat

java.lang.Object
  extended by com.sleepycat.persist.impl.Format
      extended by com.sleepycat.persist.impl.PrimitiveArrayFormat
All Implemented Interfaces:
RawType, java.io.Serializable

public class PrimitiveArrayFormat
extends Format

An array of primitives having one dimension. Multidimensional arrays are handled by ObjectArrayFormat.

See Also:
Serialized Form

Method Summary
 Format getComponentType()
          Returns the array component type, or null if this is not an array type.
 int getDimensions()
          Returns the number of array dimensions, or zero if this is not an array type.
 boolean isArray()
          Returns whether this is an array type.
 java.lang.Object newInstance(EntityInput input, boolean rawAccess)
          Creates a new instance of the target class using its default constructor.
 java.lang.Object readObject(java.lang.Object o, EntityInput input, boolean rawAccess)
          Called after newInstance() to read the rest of the data bytes and fill in the object contents.
 
Methods inherited from class com.sleepycat.persist.impl.Format
getClassName, getEnumConstants, getFields, getPreviousVersion, getSuperType, getVersion, initializeReader, isEnum, isPrimitive, isSimple, readPriKey, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isArray

public boolean isArray()
Description copied from interface: RawType
Returns whether this is an array type. Raw value arrays are represented as RawObject instances.

If true is returned, the array component type is returned by RawType.getComponentType() and the number of array dimensions is returned by RawType.getDimensions().

If false is returned, then this is a complex type, an enum type (see RawType.isEnum()), or a simple type (see RawType.isSimple()).

Specified by:
isArray in interface RawType
Overrides:
isArray in class Format

getDimensions

public int getDimensions()
Description copied from interface: RawType
Returns the number of array dimensions, or zero if this is not an array type.

Specified by:
getDimensions in interface RawType
Overrides:
getDimensions in class Format

getComponentType

public Format getComponentType()
Description copied from interface: RawType
Returns the array component type, or null if this is not an array type.

Specified by:
getComponentType in interface RawType
Overrides:
getComponentType in class Format

newInstance

public java.lang.Object newInstance(EntityInput input,
                                    boolean rawAccess)
Description copied from class: Format
Creates a new instance of the target class using its default constructor. Normally this creates an empty object, and readObject() is called next to fill in the contents. This is done in two steps to allow the instance to be registered by EntityInput before reading the contents. This allows the fields in an object or a nested object to refer to the parent object in a graph. Alternatively, this method may read all or the first portion of the data, rather than that being done by readObject(). This is required for simple types and enums, where the object cannot be created without reading the data. In these cases, there is no possibility that the parent object will be referenced by the child object in the graph. It should not be done in other cases, or the graph references may not be maintained faithfully. Is public only in order to implement the Reader interface. Note that this method should only be called directly in raw conversion mode or during conversion of an old format. Normally it should be called via the getReader method and the Reader interface.

Specified by:
newInstance in class Format

readObject

public java.lang.Object readObject(java.lang.Object o,
                                   EntityInput input,
                                   boolean rawAccess)
Description copied from class: Format
Called after newInstance() to read the rest of the data bytes and fill in the object contents. If the object was read completely by newInstance(), this method does nothing. Is public only in order to implement the Reader interface. Note that this method should only be called directly in raw conversion mode or during conversion of an old format. Normally it should be called via the getReader method and the Reader interface.

Specified by:
readObject in class Format