📄 arrayresourcebundle.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Aug 26 16:16:46 CST 1999 --><TITLE>Java Internationalization and Localization Toolkit public api document: Class ArrayResourceBundle</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> <FONT ID="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT ID="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" ID="NavBarCell2"><FONT SIZE="-2"> PREV CLASS NEXT CLASS</FONT></TD><TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="ArrayResourceBundle.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#fields_inherited_from_class_java.util.ResourceBundle">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">com.sun.tdc.util</FONT><BR>Class ArrayResourceBundle</H2><PRE>java.lang.Object | +--java.util.ResourceBundle | +--<B>com.sun.tdc.util.ArrayResourceBundle</B></PRE><HR><DL><DT>public abstract class <B>ArrayResourceBundle</B><DT>extends java.util.ResourceBundle</DL><P><code>ArrayResourceBundle</code> is a abstract subclass of <code>ResourceBundle</code> that manages resources for a locale in a convenient and easy to use array. See <code>ResourceBundle</code> for more information about resource bundles in general. <P> Subclasses must override <code>getContents</code> and provide an array, where each item in the array is an objects. The array index is the key, and the value associated with that key is the object stored with that index. [Right now, there's no error-checking code to enforce this, so you could specify value that has something other than a String as a key. But since the interfaces are defined in terms of String, any value with a key that isn't a String may cause a ClassCast Exception.] <p> Following is an example. <blockquote> <pre> //==================== class MyArrayResourceBundle extends ArrayResourceBundle { public Object[] getContents() { return contents; } static final Object[] contents = { // LOCALIZE THIS "MyDisk", // starting value in string field "3 Mar 96", // starting value in date field "no files", // first choice value "1", // second choice number "one file", // second choice value "2", // third choice number "{0}|3 files", // third choice value "format threw an exception: {0}", // generic exception message "ERROR", // what to show in field in case of error } }<P><DL><DT><B>Since: </B><DD>Toolkit2.0</DD></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="fields_inherited_from_class_java.util.ResourceBundle"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor"><TD><B>Fields inherited from class java.util.ResourceBundle</B></TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD><CODE>parent</CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" ID="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD><CODE><B><A HREF="../../../../com/sun/tdc/util/ArrayResourceBundle.html#ArrayResourceBundle()">ArrayResourceBundle</A></B>()</CODE><BR> </TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" ID="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected abstract java.lang.Object[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/sun/tdc/util/ArrayResourceBundle.html#getContents()">getContents</A></B>()</CODE><BR> See class description.</TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.util.Enumeration</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/sun/tdc/util/ArrayResourceBundle.html#getKeys()">getKeys</A></B>()</CODE><BR> Implementation of ResourceBundle.getKeys.</TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/sun/tdc/util/ArrayResourceBundle.html#getObject(int)">getObject</A></B>(int index)</CODE><BR> Get an Object value with index.</TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/sun/tdc/util/ArrayResourceBundle.html#getString(int)">getString</A></B>(int key)</CODE><BR> Get a string value with index.</TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/sun/tdc/util/ArrayResourceBundle.html#getStringArray(int)">getStringArray</A></B>(int key)</CODE><BR> Get a string array value with index.</TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../com/sun/tdc/util/ArrayResourceBundle.html#handleGetObject(java.lang.String)">handleGetObject</A></B>(java.lang.String key)</CODE><BR> Override of ResourceBundle, same semantics</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.util.ResourceBundle"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor"><TD><B>Methods inherited from class java.util.ResourceBundle</B></TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD><CODE><clinit>, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, setParent</CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" ID="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="ArrayResourceBundle()"><!-- --></A><H3>ArrayResourceBundle</H3><PRE>public <B>ArrayResourceBundle</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" ID="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getString(int)"><!-- --></A><H3>getString</H3><PRE>public final java.lang.String <B>getString</B>(int key) throws java.util.MissingResourceException</PRE><DL><DD>Get a string value with index.</DL><HR><A NAME="getStringArray(int)"><!-- --></A><H3>getStringArray</H3><PRE>public final java.lang.String[] <B>getStringArray</B>(int key) throws java.util.MissingResourceException</PRE><DL><DD>Get a string array value with index.</DL><HR><A NAME="getContents()"><!-- --></A><H3>getContents</H3><PRE>protected abstract java.lang.Object[] <B>getContents</B>()</PRE><DL><DD>See class description.</DL><HR><A NAME="handleGetObject(java.lang.String)"><!-- --></A><H3>handleGetObject</H3><PRE>protected java.lang.Object <B>handleGetObject</B>(java.lang.String key)</PRE><DL><DD>Override of ResourceBundle, same semantics<DD><DL><DT><B>Overrides:</B><DD>handleGetObject in class java.util.ResourceBundle</DL></DD></DL><HR><A NAME="getObject(int)"><!-- --></A><H3>getObject</H3><PRE>public java.lang.Object <B>getObject</B>(int index)</PRE><DL><DD>Get an Object value with index.</DL><HR><A NAME="getKeys()"><!-- --></A><H3>getKeys</H3><PRE>public java.util.Enumeration <B>getKeys</B>()</PRE><DL><DD>Implementation of ResourceBundle.getKeys.<DD><DL><DT><B>Overrides:</B><DD>getKeys in class java.util.ResourceBundle</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> <FONT ID="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT ID="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" ID="NavBarCell2"><FONT SIZE="-2"> PREV CLASS NEXT CLASS</FONT></TD><TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="ArrayResourceBundle.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#fields_inherited_from_class_java.util.ResourceBundle">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -