locale.html

来自「API資料大全」· HTML 代码 · 共 1,308 行 · 第 1/4 页

HTML
1,308
字号
<PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getVariant</B>()</PRE><DL><DD>Returns the variant code for this locale.<DD><DL></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/util/Locale.html#getDisplayVariant()"><CODE>getDisplayVariant()</CODE></A></DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public final <A HREF="../../java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Getter for the programmatic name of the entire locale, with the language, country and variant separated by underbars. Language is always lower case, and country is always upper case. If the language is missing, the string will begin with an underbar. If both the language and country fields are missing, this function will return the empty string, even if the variant field is filled in (you can't have a locale with just a variant-- the variant must accompany a valid language or country code). Examples: "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr_MAC"<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/util/Locale.html#getDisplayName()"><CODE>getDisplayName()</CODE></A></DL></DD></DL><HR><A NAME="getISO3Language()"><!-- --></A><H3>getISO3Language</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getISO3Language</B>()                       throws <A HREF="../../java/util/MissingResourceException.html">MissingResourceException</A></PRE><DL><DD>Returns a three-letter abbreviation for this locale's language.  If the locale doesn't specify a language, this will be the empty string.  Otherwise, this will be a lowercase ISO 639-2/T language code. The ISO 639-2 language codes can be found on-line at   <a href="http://www.triacom.com/archive/iso639-2.en.html><code>http://www.triacom.com/archive/iso639-2.en.html</code></a> and   <a href="ftp://dkuug.dk/i18n/iso-639-2.txt"><code>ftp://dkuug.dk/i18n/iso-639-2.txt</code></a><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/util/MissingResourceException.html">MissingResourceException</A></CODE> - Throws MissingResourceException if the three-letter language abbreviation is not available for this locale.</DL></DD></DL><HR><A NAME="getISO3Country()"><!-- --></A><H3>getISO3Country</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getISO3Country</B>()                      throws <A HREF="../../java/util/MissingResourceException.html">MissingResourceException</A></PRE><DL><DD>Returns a three-letter abbreviation for this locale's country.  If the locale doesn't specify a country, this will be tbe the empty string.  Otherwise, this will be an uppercase ISO 3166 3-letter country code.<DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/util/MissingResourceException.html">MissingResourceException</A></CODE> - Throws MissingResourceException if the three-letter country abbreviation is not available for this locale.</DL></DD></DL><HR><A NAME="getDisplayLanguage()"><!-- --></A><H3>getDisplayLanguage</H3><PRE>public final <A HREF="../../java/lang/String.html">String</A> <B>getDisplayLanguage</B>()</PRE><DL><DD>Returns a name for the locale's language that is appropriate for display to the user. If possible, the name returned will be localized for the default locale. For example, if the locale is fr_FR and the default locale is en_US, getDisplayLanguage() will return "French"; if the locale is en_US and the default locale is fr_FR, getDisplayLanguage() will return "anglais". If the name returned cannot be localized for the default locale, (say, we don't have a Japanese name for Croatian), this function falls back on the English name, and uses the ISO code as a last-resort value.  If the locale doesn't specify a language, this function returns the empty string.<DD><DL></DL></DD></DL><HR><A NAME="getDisplayLanguage(java.util.Locale)"><!-- --></A><H3>getDisplayLanguage</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getDisplayLanguage</B>(<A HREF="../../java/util/Locale.html">Locale</A>&nbsp;inLocale)</PRE><DL><DD>Returns a name for the locale's language that is appropriate for display to the user. If possible, the name returned will be localized according to inLocale. For example, if the locale is fr_FR and inLocale is en_US, getDisplayLanguage() will return "French"; if the locale is en_US and inLocale is fr_FR, getDisplayLanguage() will return "anglais". If the name returned cannot be localized according to inLocale, (say, we don't have a Japanese name for Croatian), this function falls back on the default locale, on the English name, and finally on the ISO code as a last-resort value.  If the locale doesn't specify a language, this function returns the empty string.<DD><DL></DL></DD></DL><HR><A NAME="getDisplayCountry()"><!-- --></A><H3>getDisplayCountry</H3><PRE>public final <A HREF="../../java/lang/String.html">String</A> <B>getDisplayCountry</B>()</PRE><DL><DD>Returns a name for the locale's country that is appropriate for display to the user. If possible, the name returned will be localized for the default locale. For example, if the locale is fr_FR and the default locale is en_US, getDisplayCountry() will return "France"; if the locale is en_US and the default locale is fr_FR, getDisplayLanguage() will return "Etats-Unis". If the name returned cannot be localized for the default locale, (say, we don't have a Japanese name for Croatia), this function falls back on the English name, and uses the ISO code as a last-resort value.  If the locale doesn't specify a country, this function returns the empty string.<DD><DL></DL></DD></DL><HR><A NAME="getDisplayCountry(java.util.Locale)"><!-- --></A><H3>getDisplayCountry</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getDisplayCountry</B>(<A HREF="../../java/util/Locale.html">Locale</A>&nbsp;inLocale)</PRE><DL><DD>Returns a name for the locale's country that is appropriate for display to the user. If possible, the name returned will be localized according to inLocale. For example, if the locale is fr_FR and inLocale is en_US, getDisplayCountry() will return "France"; if the locale is en_US and inLocale is fr_FR, getDisplayLanguage() will return "Etats-Unis". If the name returned cannot be localized according to inLocale. (say, we don't have a Japanese name for Croatia), this function falls back on the default locale, on the English name, and finally on the ISO code as a last-resort value.  If the locale doesn't specify a country, this function returns the empty string.<DD><DL></DL></DD></DL><HR><A NAME="getDisplayVariant()"><!-- --></A><H3>getDisplayVariant</H3><PRE>public final <A HREF="../../java/lang/String.html">String</A> <B>getDisplayVariant</B>()</PRE><DL><DD>Returns a name for the locale's variant code that is appropriate for display to the user.  If possible, the name will be localized for the default locale.  If the locale doesn't specify a variant code, this function returns the empty string.<DD><DL></DL></DD></DL><HR><A NAME="getDisplayVariant(java.util.Locale)"><!-- --></A><H3>getDisplayVariant</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getDisplayVariant</B>(<A HREF="../../java/util/Locale.html">Locale</A>&nbsp;inLocale)</PRE><DL><DD>Returns a name for the locale's variant code that is appropriate for display to the user.  If possible, the name will be localized for inLocale.  If the locale doesn't specify a variant code, this function returns the empty string.<DD><DL></DL></DD></DL><HR><A NAME="getDisplayName()"><!-- --></A><H3>getDisplayName</H3><PRE>public final <A HREF="../../java/lang/String.html">String</A> <B>getDisplayName</B>()</PRE><DL><DD>Returns a name for the locale that is appropriate for display to the user.  This will be the values returned by getDisplayLanguage(), getDisplayCountry(), and getDisplayVariant() assembled into a single string.  The display name will have one of the following forms:<p><blockquote> language (country, variant)<p> language (country)<p> language (variant)<p> country (variant)<p> language<p> country<p> variant<p></blockquote> depending on which fields are specified in the locale.  If the language, country, and variant fields are all empty, this function returns the empty string.<DD><DL></DL></DD></DL><HR><A NAME="getDisplayName(java.util.Locale)"><!-- --></A><H3>getDisplayName</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getDisplayName</B>(<A HREF="../../java/util/Locale.html">Locale</A>&nbsp;inLocale)</PRE><DL><DD>Returns a name for the locale that is appropriate for display to the user.  This will be the values returned by getDisplayLanguage(), getDisplayCountry(), and getDisplayVariant() assembled into a single string.  The display name will have one of the following forms:<p><blockquote> language (country, variant)<p> language (country)<p> language (variant)<p> country (variant)<p> language<p> country<p> variant<p></blockquote> depending on which fields are specified in the locale.  If the language, country, and variant fields are all empty, this function returns the empty string.<DD><DL></DL></DD></DL><HR><A NAME="clone()"><!-- --></A><H3>clone</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>clone</B>()</PRE><DL><DD>Overrides Cloneable<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.lang.Object</CODE></DD><DD><DL><DT><B>Returns:</B><DD>a clone of this instance.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/CloneNotSupportedException.html">CloneNotSupportedException</A></CODE> - if the object's class does not               support the <code>Cloneable</code> interface. Subclasses               that override the <code>clone</code> method can also               throw this exception to indicate that an instance cannot               be cloned.<DD><CODE><A HREF="../../java/lang/OutOfMemoryError.html">OutOfMemoryError</A></CODE> - if there is not enough memory.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Cloneable.html"><CODE>Cloneable</CODE></A></DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD>Override hashCode. Since Locales are often used in hashtables, caches the value for speed.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.lang.Object</CODE></DD><DD><DL><DT><B>Returns:</B><DD>a hash code value for this object.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Object.html#equals(java.lang.Object)"><CODE>Object.equals(java.lang.Object)</CODE></A>, <A HREF="../../java/util/Hashtable.html"><CODE>Hashtable</CODE></A></DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Returns true if this Locale is equal to another object.  A Locale is deemed equal to another Locale with identical language, country, and variant, and unequal to all other objects.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if this Locale is equal to the specified object.</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" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Locale.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/util/ListResourceBundle.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/util/Observable.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Locale.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation  contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?