|
|||||||||
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.EnumFormat
public class EnumFormat
Format for all enum types. In this class we resort to using reflection to allocate arrays of enums. If there is a need for it, reflection could be avoided in the future by generating code as new array formats are encountered.
Method Summary | |
---|---|
java.util.List<java.lang.String> |
getEnumConstants()
Returns an unmodifiable list of the names of the enum instances, or null if this is not an enum type. |
boolean |
isEnum()
Returns whether this is an enum 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, getComponentType, getDimensions, getFields, getPreviousVersion, getSuperType, getVersion, initializeReader, isArray, isPrimitive, isSimple, readPriKey, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public boolean isEnum()
RawType
If true is returned, a value of this type is a RawObject
and
the enum constant String is available via RawObject.getEnum()
.
If false is returned, then this is a complex type, an array type (see
RawType.isArray()
), or a simple type (see RawType.isSimple()
).
isEnum
in interface RawType
isEnum
in class Format
public java.util.List<java.lang.String> getEnumConstants()
RawType
getEnumConstants
in interface RawType
getEnumConstants
in class Format
public java.lang.Object newInstance(EntityInput input, boolean rawAccess)
Format
newInstance
in class Format
public java.lang.Object readObject(java.lang.Object o, EntityInput input, boolean rawAccess)
Format
readObject
in class Format
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |