Share via


DateTimePatternGenerator Class

Definition

This class provides flexible generation of date format patterns, like "yy-MM-dd".

[Android.Runtime.Register("android/icu/text/DateTimePatternGenerator", ApiSince=24, DoNotGenerateAcw=true)]
public class DateTimePatternGenerator : Java.Lang.Object, Android.Icu.Util.IFreezable, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/icu/text/DateTimePatternGenerator", ApiSince=24, DoNotGenerateAcw=true)>]
type DateTimePatternGenerator = class
    inherit Object
    interface IFreezable
    interface ICloneable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
DateTimePatternGenerator
Attributes
Implements

Remarks

This class provides flexible generation of date format patterns, like "yy-MM-dd". The user can build up the generator by adding successive patterns. Once that is done, a query can be made using a "skeleton", which is a pattern which just includes the desired fields and lengths. The generator will return the "best fit" pattern corresponding to that skeleton.

The main method people will use is getBestPattern(String skeleton), since normally this class is pre-built with data from a particular locale. However, generators can be built directly from other data as well.

Java documentation for android.icu.text.DateTimePatternGenerator.

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

DateTimePatternGenerator()

Only for use by subclasses

DateTimePatternGenerator(IntPtr, JniHandleOwnership)

Fields

Day
DayOfWeekInMonth
DayOfYear
Dayperiod
Era
FractionalSecond
Hour
MatchAllFieldsLength
Obsolete.

Option mask for forcing the width of all date and time fields.

MatchHourFieldLength
Obsolete.

Option mask for forcing the width of hour field.

MatchNoOptions
Obsolete.

Default option mask used for #getBestPattern(String, int) and #replaceFieldTypes(String, String, int).

Minute
Month
Quarter
Second
Weekday
WeekOfMonth
WeekOfYear
Year
Zone

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
DateTimeFormat

Getter corresponding to setDateTimeFormat. -or- The date time format is a message format pattern used to compose date and time patterns.

Decimal

Getter corresponding to setDecimal. -or- The decimal value is used in formatting fractions of seconds.

DefaultHourCycle
EmptyInstance

Create empty generator, to be constructed with addPattern(.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
Instance

Construct a flexible generator according to data for the default FORMAT locale.

IsFrozen

To be added

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

Methods

AddPattern(String, Boolean, DateTimePatternGenerator+PatternInfo)
Clone()

Returns a copy of this DateTimePatternGenerator object.

CloneAsThawed()

To be added

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

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

(Inherited from Object)
Freeze()

To be added

GetAppendItemFormat(DateTimePatternField)

Getter corresponding to setAppendItemFormats.

GetAppendItemName(DateTimePatternField)

Getter corresponding to setAppendItemName.

GetBaseSkeleton(String)

Utility to return a unique base skeleton from a given pattern.

GetBaseSkeletons(ICollection<String>)

Return a list of all the base skeletons (in canonical form) from this class

GetBestPattern(String, DateTimePatternMatchOptions)

Return the best pattern matching the input skeleton.

GetBestPattern(String)

Return the best pattern matching the input skeleton.

GetDateTimeFormat(Int32)

Getter corresponding to setDateTimeFormat.

GetFieldDisplayName(Int32, DateTimePatternGenerator+DisplayWidth)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetInstance(Locale)

Construct a flexible generator according to data for a given locale.

GetInstance(ULocale)

Construct a flexible generator according to data for a given locale.

GetSkeleton(String)

Utility to return a unique skeleton from a given pattern.

GetSkeletons(IDictionary<String,String>)

Return a list of all the skeletons (in canonical form) from this class, and the patterns that they map to.

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)
ReplaceFieldTypes(String, String, DateTimePatternMatchOptions)

Adjusts the field types (width and subtype) of a pattern to match what is in a skeleton.

ReplaceFieldTypes(String, String)

Adjusts the field types (width and subtype) of a pattern to match what is in a skeleton.

SetAppendItemFormat(DateTimePatternField, String)

An AppendItem format is a pattern used to append a field if there is no good match.

SetAppendItemName(DateTimePatternField, String)

Sets the names of fields, eg "era" in English for ERA.

SetDateTimeFormat(Int32, String)

dateTimeFormats are message patterns used to compose combinations of date and time patterns.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
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

IFreezable.CloneAsThawed()
IFreezable.Freeze()
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)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to