locale.html

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

HTML
1,308
字号
<A NAME="ITALIAN"><!-- --></A><H3>ITALIAN</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>ITALIAN</B></PRE><DL><DD>Useful constant for language.</DL><HR><A NAME="JAPANESE"><!-- --></A><H3>JAPANESE</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>JAPANESE</B></PRE><DL><DD>Useful constant for language.</DL><HR><A NAME="KOREAN"><!-- --></A><H3>KOREAN</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>KOREAN</B></PRE><DL><DD>Useful constant for language.</DL><HR><A NAME="CHINESE"><!-- --></A><H3>CHINESE</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>CHINESE</B></PRE><DL><DD>Useful constant for language.</DL><HR><A NAME="SIMPLIFIED_CHINESE"><!-- --></A><H3>SIMPLIFIED_CHINESE</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>SIMPLIFIED_CHINESE</B></PRE><DL><DD>Useful constant for language.</DL><HR><A NAME="TRADITIONAL_CHINESE"><!-- --></A><H3>TRADITIONAL_CHINESE</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>TRADITIONAL_CHINESE</B></PRE><DL><DD>Useful constant for language.</DL><HR><A NAME="FRANCE"><!-- --></A><H3>FRANCE</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>FRANCE</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="GERMANY"><!-- --></A><H3>GERMANY</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>GERMANY</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="ITALY"><!-- --></A><H3>ITALY</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>ITALY</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="JAPAN"><!-- --></A><H3>JAPAN</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>JAPAN</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="KOREA"><!-- --></A><H3>KOREA</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>KOREA</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="CHINA"><!-- --></A><H3>CHINA</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>CHINA</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="PRC"><!-- --></A><H3>PRC</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>PRC</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="TAIWAN"><!-- --></A><H3>TAIWAN</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>TAIWAN</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="UK"><!-- --></A><H3>UK</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>UK</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="US"><!-- --></A><H3>US</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>US</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="CANADA"><!-- --></A><H3>CANADA</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>CANADA</B></PRE><DL><DD>Useful constant for country.</DL><HR><A NAME="CANADA_FRENCH"><!-- --></A><H3>CANADA_FRENCH</H3><PRE>public static final <A HREF="../../java/util/Locale.html">Locale</A> <B>CANADA_FRENCH</B></PRE><DL><DD>Useful constant for country.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Locale(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>Locale</H3><PRE>public <B>Locale</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;language,              <A HREF="../../java/lang/String.html">String</A>&nbsp;country,              <A HREF="../../java/lang/String.html">String</A>&nbsp;variant)</PRE><DL><DD>Construct a locale from language, country, variant. NOTE:  ISO 639 is not a stable standard; some of the language codes it defines (specifically iw, ji, and in) have changed.  This constructor accepts both the old codes (iw, ji, and in) and the new codes (he, yi, and id), but all other API on Locale will return only the OLD codes.<DD><DL><DT><B>Parameters:</B><DD><CODE>language</CODE> - lowercase two-letter ISO-639 code.<DD><CODE>country</CODE> - uppercase two-letter ISO-3166 code.<DD><CODE>variant</CODE> - vendor and browser specific code. See class description.</DL></DD></DL><HR><A NAME="Locale(java.lang.String, java.lang.String)"><!-- --></A><H3>Locale</H3><PRE>public <B>Locale</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;language,              <A HREF="../../java/lang/String.html">String</A>&nbsp;country)</PRE><DL><DD>Construct a locale from language, country. To create a locale that only identifies a language, use "" for the <code>country</code>. NOTE:  ISO 639 is not a stable standard; some of the language codes it defines (specifically iw, ji, and in) have changed.  This constructor accepts both the old codes (iw, ji, and in) and the new codes (he, yi, and id), but all other API on Locale will return only the OLD codes.<DD><DL><DT><B>Parameters:</B><DD><CODE>language</CODE> - lowercase two-letter ISO-639 code.<DD><CODE>country</CODE> - uppercase two-letter ISO-3166 code.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getDefault()"><!-- --></A><H3>getDefault</H3><PRE>public static <A HREF="../../java/util/Locale.html">Locale</A> <B>getDefault</B>()</PRE><DL><DD>Gets the current value of the default locale for this instance of the Java Virtual Machine. <p> The Java Virtual Machine sets the default locale during startup based on the host environment. It is used by many locale-sensitive methods if no locale is explicitly specified. It can be changed using the <A HREF="../../java/util/Locale.html#setDefault(java.util.Locale)"><CODE>setDefault</CODE></A> method.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the default locale for this instance of the Java Virtual Machine</DL></DD></DL><HR><A NAME="setDefault(java.util.Locale)"><!-- --></A><H3>setDefault</H3><PRE>public static void <B>setDefault</B>(<A HREF="../../java/util/Locale.html">Locale</A>&nbsp;newLocale)</PRE><DL><DD>Sets the default locale for this instance of the Java Virtual Machine. This does not affect the host locale. <p> If there is a security manager, its <code>checkPermission</code> method is called with a <code>PropertyPermission("user.language", "write")</code> permission before the default locale is changed. <p> The Java Virtual Machine sets the default locale during startup based on the host environment. It is used by many locale-sensitive methods if no locale is explicitly specified. <p> Since changing the default locale may affect many different areas of functionality, this method should only be used if the caller is prepared to reinitialize locale-sensitive code running within the same Java Virtual Machine, such as the user interface.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newLocale</CODE> - the new default locale<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if a security manager exists and its        <code>checkPermission</code> method doesn't allow the operation.<DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>newLocale</code> is null<DT><B>See Also: </B><DD><A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>SecurityManager.checkPermission(java.security.Permission)</CODE></A>, <A HREF="../../java/util/PropertyPermission.html"><CODE>PropertyPermission</CODE></A></DL></DD></DL><HR><A NAME="getAvailableLocales()"><!-- --></A><H3>getAvailableLocales</H3><PRE>public static <A HREF="../../java/util/Locale.html">Locale</A>[] <B>getAvailableLocales</B>()</PRE><DL><DD>Returns a list of all installed locales.<DD><DL></DL></DD></DL><HR><A NAME="getISOCountries()"><!-- --></A><H3>getISOCountries</H3><PRE>public static <A HREF="../../java/lang/String.html">String</A>[] <B>getISOCountries</B>()</PRE><DL><DD>Returns a list of all 2-letter country codes defined in ISO 3166. Can be used to create Locales.<DD><DL></DL></DD></DL><HR><A NAME="getISOLanguages()"><!-- --></A><H3>getISOLanguages</H3><PRE>public static <A HREF="../../java/lang/String.html">String</A>[] <B>getISOLanguages</B>()</PRE><DL><DD>Returns a list of all 2-letter language codes defined in ISO 639. Can be used to create Locales. [NOTE:  ISO 639 is not a stable standard-- some languages' codes have changed. The list this function returns includes both the new and the old codes for the languages whose codes have changed.]<DD><DL></DL></DD></DL><HR><A NAME="getLanguage()"><!-- --></A><H3>getLanguage</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getLanguage</B>()</PRE><DL><DD>Returns the language code for this locale, which will either be the empty string or a lowercase ISO 639 code. <p>NOTE:  ISO 639 is not a stable standard-- some languages' codes have changed. Locale's constructor recognizes both the new and the old codes for the languages whose codes have changed, but this function always returns the old code.  If you want to check for a specific language whose code has changed, don't do <pre> if (locale.getLanguage().equals("he")    ... </pre>Instead, do<pre> if (locale.getLanguage().equals(new Locale("he", "", "").getLanguage())    ...</pre><DD><DL></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/util/Locale.html#getDisplayLanguage()"><CODE>getDisplayLanguage()</CODE></A></DL></DD></DL><HR><A NAME="getCountry()"><!-- --></A><H3>getCountry</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getCountry</B>()</PRE><DL><DD>Returns the country/region code for this locale, which will either be the empty string or an upercase ISO 3166 2-letter code.<DD><DL></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/util/Locale.html#getDisplayCountry()"><CODE>getDisplayCountry()</CODE></A></DL></DD></DL><HR><A NAME="getVariant()"><!-- --></A><H3>getVariant</H3>

⌨️ 快捷键说明

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