listresourcebundle.html
来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 388 行 · 第 1/2 页
HTML
388 行
<!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.5.0_03) on Wed Nov 02 09:51:05 CST 2005 --><META http-equiv="Content-Type" content="text/html; charset=gb2312"><TITLE>ListResourceBundle (Java 2 Platform SE 5.0)</TITLE><META NAME="keywords" CONTENT="java.util.ListResourceBundle class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="ListResourceBundle (Java 2 Platform SE 5.0)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="跳过导航链接"></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>概述</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ListResourceBundle.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Standard Ed. 5.0</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="ListIterator.html" title="java.util 中的接口"><B>上一个类</B></A> <A HREF="Locale.html" title="java.util 中的类"><B>下一个类</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html@java_2Futil_2FListResourceBundle.html" target="_top"><B>框架</B></A> <A HREF="ListResourceBundle.html" target="_top"><B>无框架</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>所有类</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>所有类</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 摘要: 嵌套 | <A HREF="#fields_inherited_from_class_java.util.ResourceBundle">字段</A> | <A HREF="#constructor_summary">构造方法</A> | <A HREF="#method_summary">方法</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">详细信息: 字段 | <A HREF="#constructor_detail">构造方法</A> | <A HREF="#method_detail">方法</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.util</FONT><BR>类 ListResourceBundle</H2><PRE><A HREF="../lang/Object.html" title="java.lang 中的类">java.lang.Object</A> <IMG SRC="../../resources/inherit.gif" ALT="继承者 "><A HREF="ResourceBundle.html" title="java.util 中的类">java.util.ResourceBundle</A> <IMG SRC="../../resources/inherit.gif" ALT="继承者 "><B>java.util.ListResourceBundle</B></PRE><HR><DL><DT><PRE>public abstract class <B>ListResourceBundle</B><DT>extends <A HREF="ResourceBundle.html" title="java.util 中的类">ResourceBundle</A></DL></PRE><P><code>ListResourceBundle</code> 是 <code>ResourceBundle</code> 的一个抽象类,用于管理方便而又易于使用的列表中的语言环境资源。有关资源包的常规信息,请参阅 <code>ResourceBundle</code>。 <P>子类必须重写 <code>getContents</code> 并提供一个数组,其中数组中的每个项都是一个对象对。每对的第一个元素是键,该键必须是一个 <code>String</code>,并且第二个元素是和该键相关联的值。 <p>下面的<a name="sample">示例</a>显示了具有基本名称 "MyResources" 的资源包系列的两个成员。"MyResources" 是资源包系列的默认成员,"MyResources_fr" 是 French 成员。这些成员是基于 <code>ListResourceBundle</code>(一个相关的<a href="PropertyResourceBundle.html#sample">示例</a>显示了如何把一个资源包添加到基于属性文件的此系列)。此示例中的键形式为 "s1" 等。实际的键完全取决于您的选择,只要它们和程序中用于从资源包中检索对象的键相同。键区分大小写。 <blockquote> <pre> public class MyResources extends ListResourceBundle { public Object[][] getContents() { return contents; } static final Object[][] contents = { // LOCALIZE THIS {"s1", "The disk \"{1}\" contains {0}."}, // MessageFormat pattern {"s2", "1"}, // location of {0} in pattern {"s3", "My Disk"}, // sample disk name {"s4", "no files"}, // first ChoiceFormat choice {"s5", "one file"}, // second ChoiceFormat choice {"s6", "{0,number} files"}, // third ChoiceFormat choice {"s7", "3 Mar 96"}, // sample date {"s8", new Dimension(1,5)} // real object, not just string // END OF MATERIAL TO LOCALIZE }; } public class MyResources_fr extends ListResourceBundle { public Object[][] getContents() { return contents; } static final Object[][] contents = { // LOCALIZE THIS {"s1", "Le disque \"{1}\" {0}."}, // MessageFormat pattern {"s2", "1"}, // location of {0} in pattern {"s3", "Mon disque"}, // sample disk name {"s4", "ne contient pas de fichiers"}, // first ChoiceFormat choice {"s5", "contient un fichier"}, // second ChoiceFormat choice {"s6", "contient {0,number} fichiers"}, // third ChoiceFormat choice {"s7", "3 mars 1996"}, // sample date {"s8", new Dimension(1,3)} // real object, not just string // END OF MATERIAL TO LOCALIZE }; } </pre> </blockquote><P><P><DL><DT><B>从以下版本开始:</B></DT> <DD>JDK1.1</DD><DT><B>另请参见:</B><DD><A HREF="ResourceBundle.html" title="java.util 中的类"><CODE>ResourceBundle</CODE></A>, <A HREF="PropertyResourceBundle.html" title="java.util 中的类"><CODE>PropertyResourceBundle</CODE></A></DL><HR><P><!-- =========== FIELD SUMMARY =========== --><A NAME="field_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>字段摘要</B></FONT></TH></TR></TABLE> <A NAME="fields_inherited_from_class_java.util.ResourceBundle"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从类 java.util.<A HREF="ResourceBundle.html" title="java.util 中的类">ResourceBundle</A> 继承的字段</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="ResourceBundle.html#parent">parent</A></CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_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>构造方法摘要</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="ListResourceBundle.html#ListResourceBundle()">ListResourceBundle</A></B>()</CODE><BR> 单独的构造方法。</TD></TR></TABLE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?