Package org.pepstock.charba.client.intl
Class DateTimeFormatOptions
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.intl.DateTimeFormatOptions
-
- All Implemented Interfaces:
IsDefaultBaseFormatOptions,IsDefaultDateTimeFormatOptions
public final class DateTimeFormatOptions extends NativeObjectContainer implements IsDefaultDateTimeFormatOptions
The object configures a date time formatter.
See MDN for more details.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDateTimeFormatOptions.DateTimeFormatOptionsFactoryCreates a date time format options by a native object and a default values instance.
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatOptions.DateTimeFormatOptionsFactoryFACTORYPublic factory to create a date time format options from a native object.
-
Constructor Summary
Constructors Constructor Description DateTimeFormatOptions()Creates new number format options object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CalendargetCalendar()Returns the calendar to use.DateTimeStylegetDateStyle()Returns the date formatting style to use when callingAbstractFormat.format(java.lang.Object).NumberItemStylegetDay()Returns the representation of the Day.StringItemStylegetDayPeriod()Returns the way day periods should be expressed.protected DgetDefaultValues()StringItemStylegetEra()Returns the representation of the Era.FormatMatchergetFormatMatcher()Returns the format matching algorithm to use.NumberItemStylegetHour()Returns the representation of the Hour.HourCyclegetHourCycle()Returns the hour cycle to use.LocaleMatchergetLocaleMatcher()Returns the locale matching algorithm to use.NumberItemStylegetMinute()Returns the representation of the Minute.MixedItemStylegetMonth()Returns the representation of the Month.NumberingSystemgetNumberingSystem()Returns the numbering system to use.NumberItemStylegetSecond()Returns the representation of the Second.DateTimeStylegetTimeStyle()Returns the time formatting style to use when callingAbstractFormat.format(java.lang.Object).TimeZonegetTimeZone()Returns the time zone to use.TimeZoneNamegetTimeZoneName()Returns the representation of the time zone name.StringItemStylegetWeekDay()Returns the representation of the WeekDay.NumberItemStylegetYear()Returns the representation of the Year.booleanisHour12()Returns whether to use 12-hour time (as opposed to 24-hour time).voidsetCalendar(Calendar calendar)Sets the calendar to use.voidsetDateStyle(DateTimeStyle style)Sets the date formatting style to use when callingAbstractFormat.format(java.lang.Object).
dateStyle can be used with timeStyle, but not with other options (e.g.voidsetDay(NumberItemStyle style)Sets the representation of the Day.voidsetDayPeriod(StringItemStyle dayPeriod)Sets the way day periods should be expressed.voidsetEra(StringItemStyle style)Sets the representation of the Era.voidsetFormatMatcher(FormatMatcher format)Sets the format matching algorithm to use.voidsetHour(NumberItemStyle style)Sets the representation of the Hour.voidsetHour12(boolean hour12)Sets whether to use 12-hour time (as opposed to 24-hour time).voidsetHourCycle(HourCycle hourCycle)Sets the hour cycle to use.
ThesetHour12(boolean)option takes precedence in case both options have been specified.voidsetLocaleMatcher(LocaleMatcher localeMatcher)Sets the locale matching algorithm to use.voidsetMinute(NumberItemStyle style)Sets the representation of the Minute.voidsetMonth(MixedItemStyle style)Sets the representation of the Month.voidsetNumberingSystem(NumberingSystem numberingSystem)Sets the numbering system to use.voidsetSecond(NumberItemStyle style)Sets the representation of the Second.voidsetTimeStyle(DateTimeStyle style)Sets the time formatting style to use when callingAbstractFormat.format(java.lang.Object).voidsetTimeZone(TimeZone zone)Sets the time zone to use.voidsetTimeZoneName(TimeZoneName timeZoneName)Sets the representation of the time zone name.voidsetWeekDay(StringItemStyle style)Sets the representation of the WeekDay.voidsetYear(NumberItemStyle style)Sets the representation of the Year.-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkAndGetColor, checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultBaseFormatOptions
getLocaleMatcher, getNumberingSystem
-
-
-
-
Field Detail
-
FACTORY
public static final DateTimeFormatOptions.DateTimeFormatOptionsFactory FACTORY
Public factory to create a date time format options from a native object.
-
-
Method Detail
-
setDateStyle
public void setDateStyle(DateTimeStyle style)
Sets the date formatting style to use when callingAbstractFormat.format(java.lang.Object).
dateStyle can be used with timeStyle, but not with other options (e.g. weekday, hour, month, etc.).- Parameters:
style- the date formatting style
-
getDateStyle
public DateTimeStyle getDateStyle()
Returns the date formatting style to use when callingAbstractFormat.format(java.lang.Object).- Specified by:
getDateStylein interfaceIsDefaultDateTimeFormatOptions- Returns:
- the date formatting style
-
setTimeStyle
public void setTimeStyle(DateTimeStyle style)
Sets the time formatting style to use when callingAbstractFormat.format(java.lang.Object). timeStyle can be used with dateStyle, but not with other options (e.g. weekday, hour, month, etc.).- Parameters:
style- the time formatting style
-
getTimeStyle
public DateTimeStyle getTimeStyle()
Returns the time formatting style to use when callingAbstractFormat.format(java.lang.Object).- Specified by:
getTimeStylein interfaceIsDefaultDateTimeFormatOptions- Returns:
- the time formatting style
-
setCalendar
public void setCalendar(Calendar calendar)
Sets the calendar to use.- Parameters:
calendar- the calendar to use
-
getCalendar
public Calendar getCalendar()
Returns the calendar to use.- Specified by:
getCalendarin interfaceIsDefaultDateTimeFormatOptions- Returns:
- the calendar to use
-
setDayPeriod
public void setDayPeriod(StringItemStyle dayPeriod)
Sets the way day periods should be expressed.- Parameters:
dayPeriod- the way day periods should be expressed
-
getDayPeriod
public StringItemStyle getDayPeriod()
Returns the way day periods should be expressed.- Specified by:
getDayPeriodin interfaceIsDefaultDateTimeFormatOptions- Returns:
- the way day periods should be expressed
-
setTimeZone
public void setTimeZone(TimeZone zone)
Sets the time zone to use.- Parameters:
zone- the time zone to use
-
getTimeZone
public TimeZone getTimeZone()
Returns the time zone to use.- Specified by:
getTimeZonein interfaceIsDefaultDateTimeFormatOptions- Returns:
- the time zone to use
-
setHour12
public void setHour12(boolean hour12)
Sets whether to use 12-hour time (as opposed to 24-hour time).- Parameters:
hour12- whether to use 12-hour time (as opposed to 24-hour time)
-
isHour12
public boolean isHour12()
Returns whether to use 12-hour time (as opposed to 24-hour time).- Specified by:
isHour12in interfaceIsDefaultDateTimeFormatOptions- Returns:
- whether to use 12-hour time (as opposed to 24-hour time)
-
setHourCycle
public void setHourCycle(HourCycle hourCycle)
Sets the hour cycle to use.
ThesetHour12(boolean)option takes precedence in case both options have been specified.- Parameters:
hourCycle- the hour cycle to use
-
getHourCycle
public HourCycle getHourCycle()
Returns the hour cycle to use.- Specified by:
getHourCyclein interfaceIsDefaultDateTimeFormatOptions- Returns:
- the hour cycle to use
-
setFormatMatcher
public void setFormatMatcher(FormatMatcher format)
Sets the format matching algorithm to use.- Parameters:
format- the format matching algorithm to use
-
getFormatMatcher
public FormatMatcher getFormatMatcher()
Returns the format matching algorithm to use.- Specified by:
getFormatMatcherin interfaceIsDefaultDateTimeFormatOptions- Returns:
- the format matching algorithm to use
-
setWeekDay
public void setWeekDay(StringItemStyle style)
Sets the representation of the WeekDay.- Parameters:
style- the representation of the WeekDay
-
getWeekDay
public StringItemStyle getWeekDay()
Returns the representation of the WeekDay.- Specified by:
getWeekDayin interfaceIsDefaultDateTimeFormatOptions- Returns:
- the representation of the WeekDay
-
setEra
public void setEra(StringItemStyle style)
Sets the representation of the Era.- Parameters:
style- the representation of the Era
-
getEra
public StringItemStyle getEra()
Returns the representation of the Era.- Specified by:
getErain interfaceIsDefaultDateTimeFormatOptions- Returns:
- the representation of the Era
-
setYear
public void setYear(NumberItemStyle style)
Sets the representation of the Year.- Parameters:
style- the representation of the Year
-
getYear
public NumberItemStyle getYear()
Returns the representation of the Year.- Specified by:
getYearin interfaceIsDefaultDateTimeFormatOptions- Returns:
- the representation of the Year
-
setMonth
public void setMonth(MixedItemStyle style)
Sets the representation of the Month.- Parameters:
style- the representation of the Month
-
getMonth
public MixedItemStyle getMonth()
Returns the representation of the Month.- Specified by:
getMonthin interfaceIsDefaultDateTimeFormatOptions- Returns:
- the representation of the Month
-
setDay
public void setDay(NumberItemStyle style)
Sets the representation of the Day.- Parameters:
style- the representation of the Day
-
getDay
public NumberItemStyle getDay()
Returns the representation of the Day.- Specified by:
getDayin interfaceIsDefaultDateTimeFormatOptions- Returns:
- the representation of the Day
-
setHour
public void setHour(NumberItemStyle style)
Sets the representation of the Hour.- Parameters:
style- the representation of the Hour
-
getHour
public NumberItemStyle getHour()
Returns the representation of the Hour.- Specified by:
getHourin interfaceIsDefaultDateTimeFormatOptions- Returns:
- the representation of the Hour
-
setMinute
public void setMinute(NumberItemStyle style)
Sets the representation of the Minute.- Parameters:
style- the representation of the Minute
-
getMinute
public NumberItemStyle getMinute()
Returns the representation of the Minute.- Specified by:
getMinutein interfaceIsDefaultDateTimeFormatOptions- Returns:
- the representation of the Minute
-
setSecond
public void setSecond(NumberItemStyle style)
Sets the representation of the Second.- Parameters:
style- the representation of the Second
-
getSecond
public NumberItemStyle getSecond()
Returns the representation of the Second.- Specified by:
getSecondin interfaceIsDefaultDateTimeFormatOptions- Returns:
- the representation of the Second
-
setTimeZoneName
public void setTimeZoneName(TimeZoneName timeZoneName)
Sets the representation of the time zone name.- Parameters:
timeZoneName- the representation of the time zone name
-
getTimeZoneName
public TimeZoneName getTimeZoneName()
Returns the representation of the time zone name.- Specified by:
getTimeZoneNamein interfaceIsDefaultDateTimeFormatOptions- Returns:
- the representation of the time zone name
-
getDefaultValues
protected final D getDefaultValues()
- Returns:
- the defaultValues
-
setLocaleMatcher
public final void setLocaleMatcher(LocaleMatcher localeMatcher)
Sets the locale matching algorithm to use.- Parameters:
localeMatcher- the locale matching algorithm to use
-
getLocaleMatcher
public final LocaleMatcher getLocaleMatcher()
Returns the locale matching algorithm to use.- Specified by:
getLocaleMatcherin interfaceIsDefaultBaseFormatOptions- Returns:
- the locale matching algorithm to use
-
setNumberingSystem
public final void setNumberingSystem(NumberingSystem numberingSystem)
Sets the numbering system to use.- Parameters:
numberingSystem- the numbering system to use
-
getNumberingSystem
public final NumberingSystem getNumberingSystem()
Returns the numbering system to use.- Specified by:
getNumberingSystemin interfaceIsDefaultBaseFormatOptions- Returns:
- the numbering system to use
-
-