com.sleepycat.persist.impl
Class SimpleFormat.FShort

java.lang.Object
  extended by com.sleepycat.persist.impl.Format
      extended by com.sleepycat.persist.impl.SimpleFormat
          extended by com.sleepycat.persist.impl.SimpleFormat.FShort
All Implemented Interfaces:
Reader, RawType, Serializable
Enclosing class:
SimpleFormat

public static class SimpleFormat.FShort
extends SimpleFormat

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sleepycat.persist.impl.SimpleFormat
SimpleFormat.FBigInt, SimpleFormat.FBool, SimpleFormat.FByte, SimpleFormat.FChar, SimpleFormat.FDate, SimpleFormat.FDouble, SimpleFormat.FFloat, SimpleFormat.FInt, SimpleFormat.FLong, SimpleFormat.FShort, SimpleFormat.FString
 
Field Summary
 
Fields inherited from class com.sleepycat.persist.impl.Format
ID_BIGDEC, ID_BIGINT, ID_BOOL, ID_BOOL_W, ID_BYTE, ID_BYTE_W, ID_CHAR, ID_CHAR_W, ID_DATE, ID_DOUBLE, ID_DOUBLE_W, ID_FLOAT, ID_FLOAT_W, ID_INT, ID_INT_W, ID_LONG, ID_LONG_W, ID_NULL, ID_NUMBER, ID_OBJECT, ID_PREDEFINED, ID_SHORT, ID_SHORT_W, ID_SIMPLE_MAX, ID_SIMPLE_MIN, ID_STRING
 
Constructor Summary
SimpleFormat.FShort(boolean primitive)
           
 
Method Summary
(package private)  void copySecKey(RecordInput input, RecordOutput output)
          Called after skipToSecKey() to copy the data bytes of a singular (XXX_TO_ONE) key field.
(package private)  int getPrimitiveLength()
           
(package private)  Format getSequenceKeyFormat()
          Validates and returns the simple integer key format for a sequence key associated with this format.
(package private)  Object newArray(int len)
          Creates an array of the format's class of the given length, as if Array.newInstance(getType(), len) were called.
 Object newInstance(EntityInput input, boolean rawAccess)
          Creates a new instance of the target class using its default constructor.
(package private)  Object newPrimitiveArray(int len, EntityInput input)
           
(package private)  void readPrimitiveField(Object o, EntityInput input, Field field)
           
(package private)  void skipContents(RecordInput input)
          Skips over the object's contents, as if readObject() were called, but without returning an object.
(package private)  void writeObject(Object o, EntityOutput output, boolean rawAccess)
          Writes a given instance of the target class to the output data bytes.
(package private)  void writePrimitiveArray(Object o, EntityOutput output)
           
(package private)  void writePrimitiveField(Object o, EntityOutput output, Field field)
           
 
Methods inherited from class com.sleepycat.persist.impl.SimpleFormat
collectRelatedFormats, copySecMultiKeyPrimitiveArray, evolve, getWrapperFormat, initialize, isPrimitive, isSimple, readObject, setWrapperFormat, skipPrimitiveArray
 
Methods inherited from class com.sleepycat.persist.impl.Format
areNestedRefsProhibited, convertRawObject, copySecMultiKey, evolveMetadata, getCatalog, getClassMetadata, getClassName, getComponentType, getDimensions, getEntityFormat, getEntityMetadata, getEnumConstants, getEvolveNeeded, getExistingType, getFields, getId, getLatestVersion, getOldKeyName, getPreviousVersion, getProxiedFormat, getReader, getSuperFormat, getSuperType, getType, getVersion, initializeIfNeeded, initializeReader, isArray, isAssignableTo, isCurrentVersion, isDeleted, isEntity, isEnum, isInitialized, isModelClass, isNew, isPredefined, isPriKeyNullOrZero, isSameClass, migrateFromBeta, nullifySecKey, readPriKey, setDeleted, setEvolveNeeded, setId, setLatestVersion, setProxiedFormat, setReader, setSuperFormat, setUnused, skipToSecKey, toString, writePriKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleFormat.FShort

SimpleFormat.FShort(boolean primitive)
Method Detail

newArray

Object newArray(int len)
Description copied from class: Format
Creates an array of the format's class of the given length, as if Array.newInstance(getType(), len) were called. Formats implement this method for specific classes, or call the accessor, to avoid the reflection overhead of Array.newInstance.

Specified by:
newArray in class Format

newInstance

public 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 interface Reader
Specified by:
newInstance in class Format

writeObject

void writeObject(Object o,
                 EntityOutput output,
                 boolean rawAccess)
Description copied from class: Format
Writes a given instance of the target class to the output data bytes. This is the complement of the newInstance()/readObject() pair.

Specified by:
writeObject in class Format

skipContents

void skipContents(RecordInput input)
Description copied from class: Format
Skips over the object's contents, as if readObject() were called, but without returning an object. Used for extracting secondary key bytes without having to instantiate the object. For reference types, the format ID is read just before calling this method, so this method is responsible for skipping everything following the format ID.

Specified by:
skipContents in class Format

copySecKey

void copySecKey(RecordInput input,
                RecordOutput output)
Description copied from class: Format
Called after skipToSecKey() to copy the data bytes of a singular (XXX_TO_ONE) key field.

Overrides:
copySecKey in class Format

newPrimitiveArray

Object newPrimitiveArray(int len,
                         EntityInput input)
Overrides:
newPrimitiveArray in class SimpleFormat

writePrimitiveArray

void writePrimitiveArray(Object o,
                         EntityOutput output)
Overrides:
writePrimitiveArray in class SimpleFormat

getPrimitiveLength

int getPrimitiveLength()
Overrides:
getPrimitiveLength in class SimpleFormat

readPrimitiveField

void readPrimitiveField(Object o,
                        EntityInput input,
                        Field field)
                  throws IllegalAccessException
Overrides:
readPrimitiveField in class SimpleFormat
Throws:
IllegalAccessException - from subclasses.

writePrimitiveField

void writePrimitiveField(Object o,
                         EntityOutput output,
                         Field field)
                   throws IllegalAccessException
Overrides:
writePrimitiveField in class SimpleFormat
Throws:
IllegalAccessException - from subclasses.

getSequenceKeyFormat

Format getSequenceKeyFormat()
Description copied from class: Format
Validates and returns the simple integer key format for a sequence key associated with this format. For a composite key type, the format of the one and only field is returned. For a simple integer type, this format is returned. Otherwise (the default implementation), an IllegalArgumentException is thrown.

Overrides:
getSequenceKeyFormat in class Format


Copyright (c) 2004-2010 Oracle. All rights reserved.