|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sleepycat.persist.impl.Format
com.sleepycat.persist.impl.SimpleFormat
public abstract class SimpleFormat
Format for simple types, including primitives. Additional methods are included to optimize the handling of primitives. Other classes such as PrimitiveArrayFormat and ReflectAccessor take advantage of these methods.
| Nested Class Summary | |
|---|---|
static class |
SimpleFormat.FBigInt
|
static class |
SimpleFormat.FBool
|
static class |
SimpleFormat.FByte
|
static class |
SimpleFormat.FChar
|
static class |
SimpleFormat.FDate
|
static class |
SimpleFormat.FDouble
|
static class |
SimpleFormat.FFloat
|
static class |
SimpleFormat.FInt
|
static class |
SimpleFormat.FLong
|
static class |
SimpleFormat.FShort
|
static class |
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(java.lang.Class type,
boolean primitive)
|
|
| Method Summary | |
|---|---|
(package private) void |
collectRelatedFormats(Catalog catalog,
java.util.Map<java.lang.String,Format> newFormats)
Calls catalog.createFormat for formats that this format depends on, or that should also be persistent. |
(package private) void |
copySecMultiKeyPrimitiveArray(int len,
RecordInput input,
java.util.Set results)
|
(package private) boolean |
evolve(Format newFormat,
Evolver evolver)
Called for an existing format that may not equal the current format for the same class. |
(package private) int |
getPrimitiveLength()
|
(package private) Format |
getWrapperFormat()
For primitive types only, returns their associated wrapper type. |
(package private) void |
initialize(Catalog catalog,
int initVersion)
Initializes an uninitialized format, initializing its related formats (superclass formats and array component formats) first. |
boolean |
isPrimitive()
Returns whether this type is a Java primitive: char, byte, short, int, long, float or double. |
boolean |
isSimple()
Returns whether this is a simple type: primitive, primitive wrapper, BigInteger, String or Date. |
(package private) java.lang.Object |
newPrimitiveArray(int len,
EntityInput input)
|
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. |
(package private) void |
readPrimitiveField(java.lang.Object o,
EntityInput input,
java.lang.reflect.Field field)
|
(package private) void |
setWrapperFormat(SimpleFormat wrapperFormat)
|
(package private) void |
skipPrimitiveArray(int len,
RecordInput input)
|
(package private) void |
writePrimitiveArray(java.lang.Object o,
EntityOutput output)
|
(package private) void |
writePrimitiveField(java.lang.Object o,
EntityOutput output,
java.lang.reflect.Field field)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
SimpleFormat(java.lang.Class type,
boolean primitive)
| Method Detail |
|---|
void setWrapperFormat(SimpleFormat wrapperFormat)
Format getWrapperFormat()
Format
getWrapperFormat in class Formatpublic boolean isSimple()
RawTypeIf true is returned, RawType.isPrimitive() can be called for more
information, and a raw value of this type is represented as a simple
type object (not as a RawObject).
If false is returned, this is a complex type, an array type (see
RawType.isArray()), or an enum type, and a raw value of this type is
represented as a RawObject.
isSimple in interface RawTypeisSimple in class Formatpublic boolean isPrimitive()
RawTypeIf true is returned, this is also a simple type. In other words, primitive types are a subset of simple types.
If true is returned, a raw value of this type is represented as a
non-null instance of the primitive type's wrapper class. For example,
an int raw value is represented as an
Integer.
isPrimitive in interface RawTypeisPrimitive in class Format
void collectRelatedFormats(Catalog catalog,
java.util.Map<java.lang.String,Format> newFormats)
Format
collectRelatedFormats in class Format
void initialize(Catalog catalog,
int initVersion)
Format
initialize in class Format
public java.lang.Object readObject(java.lang.Object o,
EntityInput input,
boolean rawAccess)
Format
readObject in interface ReaderreadObject in class Format
boolean evolve(Format newFormat,
Evolver evolver)
FormatIf this method returns true, then it must have determined that the old and new formats are equal, and it must have called either Evolver.useOldFormat or useEvolvedFormat. If this method returns false, then it must have determined that the old format could not be evolved to the new format, and it must have called Evolver.addInvalidMutation, addMissingMutation or addEvolveError.
evolve in class Format
java.lang.Object newPrimitiveArray(int len,
EntityInput input)
void writePrimitiveArray(java.lang.Object o,
EntityOutput output)
int getPrimitiveLength()
void readPrimitiveField(java.lang.Object o,
EntityInput input,
java.lang.reflect.Field field)
throws java.lang.IllegalAccessException
java.lang.IllegalAccessException
void writePrimitiveField(java.lang.Object o,
EntityOutput output,
java.lang.reflect.Field field)
throws java.lang.IllegalAccessException
java.lang.IllegalAccessException
void skipPrimitiveArray(int len,
RecordInput input)
void copySecMultiKeyPrimitiveArray(int len,
RecordInput input,
java.util.Set results)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||