Package org.pepstock.charba.client.intl
Class NumberFormatOptions
- java.lang.Object
- 
- org.pepstock.charba.client.commons.NativeObjectContainer
- 
- org.pepstock.charba.client.intl.NumberFormatOptions
 
 
- 
- All Implemented Interfaces:
- IsDefaultBaseFormatOptions,- IsDefaultNumberFormatOptions
 
 public final class NumberFormatOptions extends NativeObjectContainer implements IsDefaultNumberFormatOptions The object configures a number formatter.
 See MDN for more details.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classNumberFormatOptions.NumberFormatOptionsFactoryCreates a number format options by a native object and a default values instance.
 - 
Field SummaryFields Modifier and Type Field Description static NumberFormatOptions.NumberFormatOptionsFactoryFACTORYPublic factory to create a number format options from a native object.
 - 
Constructor SummaryConstructors Constructor Description NumberFormatOptions()Creates new number format options object.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description CompactDisplaygetCompactDisplay()Returns the compact display whenNotation.COMPACTis set.CurrencygetCurrency()Returns the currency to use in currency formatting.CurrencyDisplaygetCurrencyDisplay()Returns how to display the currency in currency formatting.CurrencySigngetCurrencySign()In many locales, accounting format means to wrap the number with parentheses instead of appending a minus sign.
 You can enable this formatting by setting the currency sign option to "accounting" otherwise "standard".protected DgetDefaultValues()LocaleMatchergetLocaleMatcher()Returns the locale matching algorithm to use.intgetMaximumFractionDigits()Returns the maximum number of fraction digits to use.
 The default for plain number formatting is the larger ofgetMinimumFractionDigits()and 3.
 The default for currency formatting is the larger ofgetMinimumFractionDigits()and the number of minor unit digits provided by currency, seeCurrency.getMinimumFractionDigits().
 The default for percent formatting is the larger ofgetMinimumFractionDigits()and 0.intgetMaximumSignificantDigits()Returns the maximum number of significant digits to use.intgetMinimumFractionDigits()Returns the minimum number of fraction digits to use.
 The default for plain number and percent formatting is 0.
 The default for currency formatting is the number of minor unit digits provided by the currency, seeCurrency.getMinimumFractionDigits().intgetMinimumIntegerDigits()Returns the minimum number of integer digits to use.intgetMinimumSignificantDigits()Returns the minimum number of significant digits to use.NotationgetNotation()Returns the formatting that should be displayed for the number.NumberingSystemgetNumberingSystem()Returns the numbering system to use.SignDisplaygetSignDisplay()Returns when to display the sign for the number.StylegetStyle()Returns the formatting style to use.MeasureUnitDisplaygetUnitOfMeasureDisplay()Returns the unit formatting style to use in unit formatting.List<MeasureUnit>getUnitsOfMeasure()Returns an unmodifiable list of units to use in unit formatting.booleanisUseGrouping()Returnstruewhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators.voidload(ChartEnvelop<NativeObject> envelop)Loads theNativeObjectin the envelop passed as argument.
 This method is called fromHelpers.formatNumber(double, CLocale, NumberFormatOptions).voidsetCompactDisplay(CompactDisplay display)Set the compact display whenNotation.COMPACTis set.voidsetCurrency(Currency currency)Sets the currency to use in currency formatting.voidsetCurrencyDisplay(CurrencyDisplay currencyDisplay)Sets how to display the currency in currency formatting.voidsetCurrencySign(CurrencySign currencySign)In many locales, accounting format means to wrap the number with parentheses instead of appending a minus sign.
 You can enable this formatting by setting the currency sign option to "accounting" otherwise "standard".voidsetLocaleMatcher(LocaleMatcher localeMatcher)Sets the locale matching algorithm to use.voidsetMaximumFractionDigits(int maximumFractionDigits)Sets the maximum number of fraction digits to use.
 Possible values are from 0 to 20.voidsetMaximumSignificantDigits(int minimumIntegerDigits)Sets the maximum number of significant digits to use.
 Possible values are from 1 to 21.voidsetMinimumFractionDigits(int minimumFractionDigits)Sets the minimum number of fraction digits to use.
 Possible values are from 0 to 20.voidsetMinimumIntegerDigits(int minimumIntegerDigits)Sets the minimum number of integer digits to use.
 Possible values are from 1 to 21.voidsetMinimumSignificantDigits(int minimumIntegerDigits)Sets the minimum number of significant digits to use.
 Possible values are from 1 to 21.voidsetNotation(Notation notation)Sets the formatting that should be displayed for the number.voidsetNumberingSystem(NumberingSystem numberingSystem)Sets the numbering system to use.voidsetSignDisplay(SignDisplay signDisplay)Sets when to display the sign for the number.voidsetStyle(Style style)Sets the formatting style to use.voidsetUnitOfMeasureDisplay(MeasureUnitDisplay unitDisplay)Sets the unit formatting style to use in unit formatting.voidsetUnitsOfMeasure(List<MeasureUnit> units)Sets the unit to use in unit formatting.
 If more that 1 unit has been passed, a compound unit has been created.voidsetUnitsOfMeasure(MeasureUnit... units)Sets the unit to use in unit formatting.
 If more that 1 unit has been passed, a compound unit has been created.voidsetUseGrouping(boolean useGrouping)Setstruewhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators.- 
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainercheckAndGetColor, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultBaseFormatOptionsgetLocaleMatcher, getNumberingSystem
 - 
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultNumberFormatOptionscreate, create
 
- 
 
- 
- 
- 
Field Detail- 
FACTORYpublic static final NumberFormatOptions.NumberFormatOptionsFactory FACTORY Public factory to create a number format options from a native object.
 
- 
 - 
Method Detail- 
setCompactDisplaypublic void setCompactDisplay(CompactDisplay display) Set the compact display whenNotation.COMPACTis set.- Parameters:
- display- the compact display when- Notation.COMPACTis set
 
 - 
getCompactDisplaypublic CompactDisplay getCompactDisplay() Returns the compact display whenNotation.COMPACTis set.- Specified by:
- getCompactDisplayin interface- IsDefaultNumberFormatOptions
- Returns:
- the compact display when Notation.COMPACTis set
 
 - 
setCurrencypublic void setCurrency(Currency currency) Sets the currency to use in currency formatting.- Parameters:
- currency- the currency to use in currency formatting
 
 - 
getCurrencypublic Currency getCurrency() Returns the currency to use in currency formatting.- Specified by:
- getCurrencyin interface- IsDefaultNumberFormatOptions
- Returns:
- the currency to use in currency formatting
 
 - 
setCurrencyDisplaypublic void setCurrencyDisplay(CurrencyDisplay currencyDisplay) Sets how to display the currency in currency formatting.- Parameters:
- currencyDisplay- how to display the currency in currency formatting
 
 - 
getCurrencyDisplaypublic CurrencyDisplay getCurrencyDisplay() Returns how to display the currency in currency formatting.- Specified by:
- getCurrencyDisplayin interface- IsDefaultNumberFormatOptions
- Returns:
- how to display the currency in currency formatting
 
 - 
setCurrencySignpublic void setCurrencySign(CurrencySign currencySign) In many locales, accounting format means to wrap the number with parentheses instead of appending a minus sign.
 You can enable this formatting by setting the currency sign option to "accounting" otherwise "standard".- Parameters:
- currencySign- the currency format to use on formatting
 
 - 
getCurrencySignpublic CurrencySign getCurrencySign() In many locales, accounting format means to wrap the number with parentheses instead of appending a minus sign.
 You can enable this formatting by setting the currency sign option to "accounting" otherwise "standard".- Specified by:
- getCurrencySignin interface- IsDefaultNumberFormatOptions
- Returns:
- the currency format to use on formatting
 
 - 
setNotationpublic void setNotation(Notation notation) Sets the formatting that should be displayed for the number.- Parameters:
- notation- the formatting that should be displayed for the number
 
 - 
getNotationpublic Notation getNotation() Returns the formatting that should be displayed for the number.- Specified by:
- getNotationin interface- IsDefaultNumberFormatOptions
- Returns:
- the formatting that should be displayed for the number
 
 - 
setSignDisplaypublic void setSignDisplay(SignDisplay signDisplay) Sets when to display the sign for the number.- Parameters:
- signDisplay- when to display the sign for the number
 
 - 
getSignDisplaypublic SignDisplay getSignDisplay() Returns when to display the sign for the number.- Specified by:
- getSignDisplayin interface- IsDefaultNumberFormatOptions
- Returns:
- when to display the sign for the number
 
 - 
setStylepublic void setStyle(Style style) Sets the formatting style to use.- Parameters:
- style- the formatting style to use
 
 - 
getStylepublic Style getStyle() Returns the formatting style to use.- Specified by:
- getStylein interface- IsDefaultNumberFormatOptions
- Returns:
- the formatting style to use
 
 - 
setUnitsOfMeasurepublic void setUnitsOfMeasure(MeasureUnit... units) Sets the unit to use in unit formatting.
 If more that 1 unit has been passed, a compound unit has been created.- Parameters:
- units- the units to use in units formatting
 
 - 
setUnitsOfMeasurepublic void setUnitsOfMeasure(List<MeasureUnit> units) Sets the unit to use in unit formatting.
 If more that 1 unit has been passed, a compound unit has been created.- Parameters:
- units- the units to use in units formatting
 
 - 
getUnitsOfMeasurepublic List<MeasureUnit> getUnitsOfMeasure() Returns an unmodifiable list of units to use in unit formatting.- Specified by:
- getUnitsOfMeasurein interface- IsDefaultNumberFormatOptions
- Returns:
- an unmodifiable list of unit to use in unit formatting
 
 - 
setUnitOfMeasureDisplaypublic void setUnitOfMeasureDisplay(MeasureUnitDisplay unitDisplay) Sets the unit formatting style to use in unit formatting.- Parameters:
- unitDisplay- the unit formatting style to use in unit formatting
 
 - 
getUnitOfMeasureDisplaypublic MeasureUnitDisplay getUnitOfMeasureDisplay() Returns the unit formatting style to use in unit formatting.- Specified by:
- getUnitOfMeasureDisplayin interface- IsDefaultNumberFormatOptions
- Returns:
- the unit formatting style to use in unit formatting
 
 - 
setUseGroupingpublic void setUseGrouping(boolean useGrouping) Setstruewhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators.- Parameters:
- useGrouping-- truewhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators
 
 - 
isUseGroupingpublic boolean isUseGrouping() Returnstruewhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators.- Specified by:
- isUseGroupingin interface- IsDefaultNumberFormatOptions
- Returns:
- truewhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators
 
 - 
setMinimumIntegerDigitspublic void setMinimumIntegerDigits(int minimumIntegerDigits) Sets the minimum number of integer digits to use.
 Possible values are from 1 to 21.- Parameters:
- minimumIntegerDigits- the minimum number of integer digits to use
 
 - 
getMinimumIntegerDigitspublic int getMinimumIntegerDigits() Returns the minimum number of integer digits to use.- Specified by:
- getMinimumIntegerDigitsin interface- IsDefaultNumberFormatOptions
- Returns:
- the minimum number of integer digits to use
 
 - 
setMinimumFractionDigitspublic void setMinimumFractionDigits(int minimumFractionDigits) Sets the minimum number of fraction digits to use.
 Possible values are from 0 to 20.- Parameters:
- minimumFractionDigits- the minimum number of fraction digits to use
 
 - 
getMinimumFractionDigitspublic int getMinimumFractionDigits() Returns the minimum number of fraction digits to use.
 The default for plain number and percent formatting is 0.
 The default for currency formatting is the number of minor unit digits provided by the currency, seeCurrency.getMinimumFractionDigits().- Specified by:
- getMinimumFractionDigitsin interface- IsDefaultNumberFormatOptions
- Returns:
- the minimum number of fraction digits to use.
 The default for plain number and percent formatting is 0.
 The default for currency formatting is the number of minor unit digits provided by the currency, seeCurrency.getMinimumFractionDigits()
 
 - 
setMaximumFractionDigitspublic void setMaximumFractionDigits(int maximumFractionDigits) Sets the maximum number of fraction digits to use.
 Possible values are from 0 to 20.- Parameters:
- maximumFractionDigits- the maximum number of fraction digits to use
 
 - 
getMaximumFractionDigitspublic int getMaximumFractionDigits() Returns the maximum number of fraction digits to use.
 The default for plain number formatting is the larger ofgetMinimumFractionDigits()and 3.
 The default for currency formatting is the larger ofgetMinimumFractionDigits()and the number of minor unit digits provided by currency, seeCurrency.getMinimumFractionDigits().
 The default for percent formatting is the larger ofgetMinimumFractionDigits()and 0.- Specified by:
- getMaximumFractionDigitsin interface- IsDefaultNumberFormatOptions
- Returns:
- the maximum number of fraction digits to use.
 The default for plain number formatting is the larger ofgetMinimumFractionDigits()and 3.
 The default for currency formatting is the larger ofgetMinimumFractionDigits()and the number of minor unit digits provided by currency, seeCurrency.getMinimumFractionDigits().
 The default for percent formatting is the larger ofgetMinimumFractionDigits()and 0.
 
 - 
setMinimumSignificantDigitspublic void setMinimumSignificantDigits(int minimumIntegerDigits) Sets the minimum number of significant digits to use.
 Possible values are from 1 to 21.- Parameters:
- minimumIntegerDigits- the minimum number of significant digits to use
 
 - 
getMinimumSignificantDigitspublic int getMinimumSignificantDigits() Returns the minimum number of significant digits to use.- Specified by:
- getMinimumSignificantDigitsin interface- IsDefaultNumberFormatOptions
- Returns:
- the minimum number of significant digits to use
 
 - 
setMaximumSignificantDigitspublic void setMaximumSignificantDigits(int minimumIntegerDigits) Sets the maximum number of significant digits to use.
 Possible values are from 1 to 21.- Parameters:
- minimumIntegerDigits- the maximum number of significant digits to use
 
 - 
getMaximumSignificantDigitspublic int getMaximumSignificantDigits() Returns the maximum number of significant digits to use.- Specified by:
- getMaximumSignificantDigitsin interface- IsDefaultNumberFormatOptions
- Returns:
- the maximum number of significant digits to use
 
 - 
loadpublic void load(ChartEnvelop<NativeObject> envelop) Loads theNativeObjectin the envelop passed as argument.
 This method is called fromHelpers.formatNumber(double, CLocale, NumberFormatOptions).- Parameters:
- envelop- envelop where loads the- NativeObject
 
 - 
getDefaultValuesprotected final D getDefaultValues() - Returns:
- the defaultValues
 
 - 
setLocaleMatcherpublic final void setLocaleMatcher(LocaleMatcher localeMatcher) Sets the locale matching algorithm to use.- Parameters:
- localeMatcher- the locale matching algorithm to use
 
 - 
getLocaleMatcherpublic final LocaleMatcher getLocaleMatcher() Returns the locale matching algorithm to use.- Specified by:
- getLocaleMatcherin interface- IsDefaultBaseFormatOptions
- Returns:
- the locale matching algorithm to use
 
 - 
setNumberingSystempublic final void setNumberingSystem(NumberingSystem numberingSystem) Sets the numbering system to use.- Parameters:
- numberingSystem- the numbering system to use
 
 - 
getNumberingSystempublic final NumberingSystem getNumberingSystem() Returns the numbering system to use.- Specified by:
- getNumberingSystemin interface- IsDefaultBaseFormatOptions
- Returns:
- the numbering system to use
 
 
- 
 
-