|
|||||||||
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.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_OBJECT, ID_PREDEFINED, ID_SHORT, ID_SHORT_W, ID_SIMPLE_MAX, ID_SIMPLE_MIN, ID_STRING |
Constructor Summary | |
---|---|
SimpleFormat(Class type,
boolean primitive)
|
Method Summary | |
---|---|
(package private) void |
collectRelatedFormats(Catalog catalog,
Map<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,
EntityInput input,
Set results)
|
boolean |
equals(Object other)
Used to compare the current version and an old version, to determine whether class evolution is needed. |
(package private) int |
getPrimitiveLength()
|
(package private) Format |
getWrapperFormat()
For primitive types only, returns their associated wrapper type. |
(package private) void |
initialize(Catalog catalog)
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, String or Date. |
(package private) Object |
newPrimitiveArray(int len,
EntityInput input)
|
(package private) void |
readObject(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(Object o,
EntityInput input,
Field field)
|
(package private) void |
setWrapperFormat(SimpleFormat wrapperFormat)
|
(package private) void |
skipPrimitiveArray(int len,
EntityInput input)
|
(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.Format |
---|
copySecKey, copySecMultiKey, evolveTo, getClassMetadata, getClassName, getComponentType, getDimensions, getEntityFormat, getEntityMetadata, getEnumConstants, getFields, getId, getProxiedFormat, getSuperFormat, getSuperType, getType, getVersion, initializeIfNeeded, isArray, isAssignableTo, isCurrentVersion, isEntity, isEnum, isModelClass, isPredefined, isPriKeyNullOrZero, newArray, newInstance, nullifySecKey, readPriKey, setId, setProxiedFormat, setSuperFormat, skipContents, skipToSecKey, writeObject, writePriKey |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
SimpleFormat(Class type, boolean primitive)
Method Detail |
---|
void setWrapperFormat(SimpleFormat wrapperFormat)
Format getWrapperFormat()
Format
getWrapperFormat
in class Format
public boolean isSimple()
RawType
If 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 RawType
isSimple
in class Format
public boolean isPrimitive()
RawType
If 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 RawType
isPrimitive
in class Format
void collectRelatedFormats(Catalog catalog, Map<String,Format> newFormats)
Format
collectRelatedFormats
in class Format
void initialize(Catalog catalog)
Format
initialize
in class Format
void readObject(Object o, EntityInput input, boolean rawAccess)
Format
readObject
in class Format
public boolean equals(Object other)
Format
equals
in class Format
Object newPrimitiveArray(int len, EntityInput input)
void writePrimitiveArray(Object o, EntityOutput output)
int getPrimitiveLength()
void readPrimitiveField(Object o, EntityInput input, Field field) throws IllegalAccessException
IllegalAccessException
void writePrimitiveField(Object o, EntityOutput output, Field field) throws IllegalAccessException
IllegalAccessException
void skipPrimitiveArray(int len, EntityInput input)
void copySecMultiKeyPrimitiveArray(int len, EntityInput input, Set results)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |