Aracılığıyla paylaş


Locale.Builder Class

Definition

Builder is used to build instances of Locale from values configured by the setters.

[Android.Runtime.Register("java/util/Locale$Builder", DoNotGenerateAcw=true)]
public sealed class Locale.Builder : Java.Lang.Object
[<Android.Runtime.Register("java/util/Locale$Builder", DoNotGenerateAcw=true)>]
type Locale.Builder = class
    inherit Object
Inheritance
Locale.Builder
Attributes

Remarks

Builder is used to build instances of Locale from values configured by the setters. Unlike the Locale constructors, the Builder checks if a value configured by a setter satisfies the syntax requirements defined by the Locale class. A Locale object created by a Builder is well-formed and can be transformed to a well-formed IETF BCP 47 language tag without losing information.

<b>Note:</b> The Locale class does not provide any syntactic restrictions on variant, while BCP 47 requires each variant subtag to be 5 to 8 alphanumerics or a single numeric followed by 3 alphanumerics. The method setVariant throws IllformedLocaleException for a variant that does not satisfy this restriction. If it is necessary to support such a variant, use a Locale constructor. However, keep in mind that a Locale object created this way might lose the variant information when transformed to a BCP 47 language tag.

The following example shows how to create a Locale object with the Builder. <blockquote>

Locale aLocale = new Builder().setLanguage("sr").setScript("Latn").setRegion("RS").build();

</blockquote>

Builders can be reused; clear() resets all fields to their default values.

Added in 1.7.

Java documentation for java.util.Locale.Builder.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Locale.Builder()

Constructs an empty Builder.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

AddUnicodeLocaleAttribute(String)
Build()

Returns an instance of Locale created from the fields set on this builder.

Clear()
ClearExtensions()
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
RemoveUnicodeLocaleAttribute(String)
SetExtension(Char, String)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetLanguage(String)
SetLanguageTag(String)
SetLocale(Locale)
SetRegion(String)
SetScript(String)
SetUnicodeLocaleKeyword(String, String)
SetVariant(String)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to