<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_0) on Wed Dec 30 04:50:28 EST 2009 --> <TITLE> EnumFormat </TITLE> <META NAME="date" CONTENT="2009-12-30"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="EnumFormat"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/sleepycat/persist/impl/EntityOutput.html" title="interface in com.sleepycat.persist.impl"><B>PREV CLASS</B></A> <A HREF="../../../../com/sleepycat/persist/impl/Format.html" title="class in com.sleepycat.persist.impl"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?com/sleepycat/persist/impl/EnumFormat.html" target="_top"><B>FRAMES</B></A> <A HREF="EnumFormat.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.sleepycat.persist.impl</FONT> <BR> Class EnumFormat</H2> <PRE> java.lang.Object <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/sleepycat/persist/impl/Format.html" title="class in com.sleepycat.persist.impl">com.sleepycat.persist.impl.Format</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.sleepycat.persist.impl.EnumFormat</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A>, java.io.Serializable</DD> </DL> <HR> <DL> <DT><PRE>public class <B>EnumFormat</B><DT>extends <A HREF="../../../../com/sleepycat/persist/impl/Format.html" title="class in com.sleepycat.persist.impl">Format</A></DL> </PRE> <P> 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. <P> <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../serialized-form.html#com.sleepycat.persist.impl.EnumFormat">Serialized Form</A></DL> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.List<java.lang.String></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/sleepycat/persist/impl/EnumFormat.html#getEnumConstants()">getEnumConstants</A></B>()</CODE> <BR> Returns an unmodifiable list of the names of the enum instances, or null if this is not an enum type.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/sleepycat/persist/impl/EnumFormat.html#isEnum()">isEnum</A></B>()</CODE> <BR> Returns whether this is an enum type.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/sleepycat/persist/impl/EnumFormat.html#newInstance(com.sleepycat.persist.impl.EntityInput, boolean)">newInstance</A></B>(<A HREF="../../../../com/sleepycat/persist/impl/EntityInput.html" title="interface in com.sleepycat.persist.impl">EntityInput</A> input, boolean rawAccess)</CODE> <BR> Creates a new instance of the target class using its default constructor.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/sleepycat/persist/impl/EnumFormat.html#readObject(java.lang.Object, com.sleepycat.persist.impl.EntityInput, boolean)">readObject</A></B>(java.lang.Object o, <A HREF="../../../../com/sleepycat/persist/impl/EntityInput.html" title="interface in com.sleepycat.persist.impl">EntityInput</A> input, boolean rawAccess)</CODE> <BR> Called after newInstance() to read the rest of the data bytes and fill in the object contents.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.sleepycat.persist.impl.Format"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class com.sleepycat.persist.impl.<A HREF="../../../../com/sleepycat/persist/impl/Format.html" title="class in com.sleepycat.persist.impl">Format</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html#getClassName()">getClassName</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#getComponentType()">getComponentType</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#getDimensions()">getDimensions</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#getFields()">getFields</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#getPreviousVersion()">getPreviousVersion</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#getSuperType()">getSuperType</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#getVersion()">getVersion</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#initializeReader(com.sleepycat.persist.impl.Catalog, int, com.sleepycat.persist.impl.Format)">initializeReader</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#isArray()">isArray</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#isPrimitive()">isPrimitive</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#isSimple()">isSimple</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#readPriKey(java.lang.Object, com.sleepycat.persist.impl.EntityInput, boolean)">readPriKey</A>, <A HREF="../../../../com/sleepycat/persist/impl/Format.html#toString()">toString</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="isEnum()"><!-- --></A><H3> isEnum</H3> <PRE> public boolean <B>isEnum</B>()</PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/sleepycat/persist/raw/RawType.html#isEnum()">RawType</A></CODE></B></DD> <DD>Returns whether this is an enum type. <p>If true is returned, a value of this type is a <A HREF="../../../../com/sleepycat/persist/raw/RawObject.html" title="class in com.sleepycat.persist.raw"><CODE>RawObject</CODE></A> and the enum constant String is available via <A HREF="../../../../com/sleepycat/persist/raw/RawObject.html#getEnum()"><CODE>RawObject.getEnum()</CODE></A>.</p> <p>If false is returned, then this is a complex type, an array type (see <A HREF="../../../../com/sleepycat/persist/raw/RawType.html#isArray()"><CODE>RawType.isArray()</CODE></A>), or a simple type (see <A HREF="../../../../com/sleepycat/persist/raw/RawType.html#isSimple()"><CODE>RawType.isSimple()</CODE></A>).</p> <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/sleepycat/persist/raw/RawType.html#isEnum()">isEnum</A></CODE> in interface <CODE><A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html#isEnum()">isEnum</A></CODE> in class <CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html" title="class in com.sleepycat.persist.impl">Format</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getEnumConstants()"><!-- --></A><H3> getEnumConstants</H3> <PRE> public java.util.List<java.lang.String> <B>getEnumConstants</B>()</PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../../com/sleepycat/persist/raw/RawType.html#getEnumConstants()">RawType</A></CODE></B></DD> <DD>Returns an unmodifiable list of the names of the enum instances, or null if this is not an enum type. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/sleepycat/persist/raw/RawType.html#getEnumConstants()">getEnumConstants</A></CODE> in interface <CODE><A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html#getEnumConstants()">getEnumConstants</A></CODE> in class <CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html" title="class in com.sleepycat.persist.impl">Format</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="newInstance(com.sleepycat.persist.impl.EntityInput, boolean)"><!-- --></A><H3> newInstance</H3> <PRE> public java.lang.Object <B>newInstance</B>(<A HREF="../../../../com/sleepycat/persist/impl/EntityInput.html" title="interface in com.sleepycat.persist.impl">EntityInput</A> input, boolean rawAccess)</PRE> <DL> <DD><B>Description copied from class: <CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html#newInstance(com.sleepycat.persist.impl.EntityInput, boolean)">Format</A></CODE></B></DD> <DD>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. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html#newInstance(com.sleepycat.persist.impl.EntityInput, boolean)">newInstance</A></CODE> in class <CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html" title="class in com.sleepycat.persist.impl">Format</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="readObject(java.lang.Object, com.sleepycat.persist.impl.EntityInput, boolean)"><!-- --></A><H3> readObject</H3> <PRE> public java.lang.Object <B>readObject</B>(java.lang.Object o, <A HREF="../../../../com/sleepycat/persist/impl/EntityInput.html" title="interface in com.sleepycat.persist.impl">EntityInput</A> input, boolean rawAccess)</PRE> <DL> <DD><B>Description copied from class: <CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html#readObject(java.lang.Object, com.sleepycat.persist.impl.EntityInput, boolean)">Format</A></CODE></B></DD> <DD>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. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html#readObject(java.lang.Object, com.sleepycat.persist.impl.EntityInput, boolean)">readObject</A></CODE> in class <CODE><A HREF="../../../../com/sleepycat/persist/impl/Format.html" title="class in com.sleepycat.persist.impl">Format</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/sleepycat/persist/impl/EntityOutput.html" title="interface in com.sleepycat.persist.impl"><B>PREV CLASS</B></A> <A HREF="../../../../com/sleepycat/persist/impl/Format.html" title="class in com.sleepycat.persist.impl"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?com/sleepycat/persist/impl/EnumFormat.html" target="_top"><B>FRAMES</B></A> <A HREF="EnumFormat.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>