Class AbstractNumberFormat
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.options.AbstractNumberFormat
-
- All Implemented Interfaces:
IsDefaultBaseFormatOptions,IsDefaultNumberFormatOptions,IsNumberFormat
- Direct Known Subclasses:
NumberFormatItem,TicksNumberFormat
public abstract class AbstractNumberFormat extends AbstractNode implements IsNumberFormat
This is abstract number format object element of the chart options.- Author:
- Andrea "Stock" Stocchero
- See Also:
NumberFormatOptions
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractNumberFormat(IsDefaultNumberFormatOptions defaultValues)Creates an empty font to use for chart configuration.protectedAbstractNumberFormat(IsDefaultNumberFormatOptions defaultValues, NativeObject nativeObject)Creates a number format to use for chart configuration, wrapping a native object instance.
-
Method Summary
All 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".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 ofNumberFormatOptions.getMinimumFractionDigits()and 3.
The default for currency formatting is the larger ofNumberFormatOptions.getMinimumFractionDigits()and the number of minor unit digits provided by currency, seeCurrency.getMinimumFractionDigits().
The default for percent formatting is the larger ofNumberFormatOptions.getMinimumFractionDigits()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.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.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
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, 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.IsDefaultNumberFormatOptions
create, create
-
-
-
-
Constructor Detail
-
AbstractNumberFormat
protected AbstractNumberFormat(IsDefaultNumberFormatOptions defaultValues)
Creates an empty font to use for chart configuration.- Parameters:
defaultValues- default provider
-
AbstractNumberFormat
protected AbstractNumberFormat(IsDefaultNumberFormatOptions defaultValues, NativeObject nativeObject)
Creates a number format to use for chart configuration, wrapping a native object instance.- Parameters:
defaultValues- default providernativeObject- native object to map java script properties
-
-
Method Detail
-
setLocaleMatcher
public void setLocaleMatcher(LocaleMatcher localeMatcher)
Sets the locale matching algorithm to use.- Specified by:
setLocaleMatcherin interfaceIsNumberFormat- Parameters:
localeMatcher- the locale matching algorithm to use
-
getLocaleMatcher
public LocaleMatcher getLocaleMatcher()
Returns the locale matching algorithm to use.- Specified by:
getLocaleMatcherin interfaceIsDefaultBaseFormatOptions- Returns:
- the locale matching algorithm to use
-
setNumberingSystem
public void setNumberingSystem(NumberingSystem numberingSystem)
Sets the numbering system to use.- Specified by:
setNumberingSystemin interfaceIsNumberFormat- Parameters:
numberingSystem- the numbering system to use
-
getNumberingSystem
public NumberingSystem getNumberingSystem()
Returns the numbering system to use.- Specified by:
getNumberingSystemin interfaceIsDefaultBaseFormatOptions- Returns:
- the numbering system to use
-
setCompactDisplay
public void setCompactDisplay(CompactDisplay display)
Set the compact display whenNotation.COMPACTis set.- Specified by:
setCompactDisplayin interfaceIsNumberFormat- Parameters:
display- the compact display whenNotation.COMPACTis set
-
getCompactDisplay
public CompactDisplay getCompactDisplay()
Returns the compact display whenNotation.COMPACTis set.- Specified by:
getCompactDisplayin interfaceIsDefaultNumberFormatOptions- Returns:
- the compact display when
Notation.COMPACTis set
-
setCurrency
public void setCurrency(Currency currency)
Sets the currency to use in currency formatting.- Specified by:
setCurrencyin interfaceIsNumberFormat- Parameters:
currency- the currency to use in currency formatting
-
getCurrency
public Currency getCurrency()
Returns the currency to use in currency formatting.- Specified by:
getCurrencyin interfaceIsDefaultNumberFormatOptions- Returns:
- the currency to use in currency formatting
-
setCurrencyDisplay
public void setCurrencyDisplay(CurrencyDisplay currencyDisplay)
Sets how to display the currency in currency formatting.- Specified by:
setCurrencyDisplayin interfaceIsNumberFormat- Parameters:
currencyDisplay- how to display the currency in currency formatting
-
getCurrencyDisplay
public CurrencyDisplay getCurrencyDisplay()
Returns how to display the currency in currency formatting.- Specified by:
getCurrencyDisplayin interfaceIsDefaultNumberFormatOptions- Returns:
- how to display the currency in currency formatting
-
setCurrencySign
public 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".- Specified by:
setCurrencySignin interfaceIsNumberFormat- Parameters:
currencySign- the currency format to use on formatting
-
getCurrencySign
public 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 interfaceIsDefaultNumberFormatOptions- Returns:
- the currency format to use on formatting
-
setNotation
public void setNotation(Notation notation)
Sets the formatting that should be displayed for the number.- Specified by:
setNotationin interfaceIsNumberFormat- Parameters:
notation- the formatting that should be displayed for the number
-
getNotation
public Notation getNotation()
Returns the formatting that should be displayed for the number.- Specified by:
getNotationin interfaceIsDefaultNumberFormatOptions- Returns:
- the formatting that should be displayed for the number
-
setSignDisplay
public void setSignDisplay(SignDisplay signDisplay)
Sets when to display the sign for the number.- Specified by:
setSignDisplayin interfaceIsNumberFormat- Parameters:
signDisplay- when to display the sign for the number
-
getSignDisplay
public SignDisplay getSignDisplay()
Returns when to display the sign for the number.- Specified by:
getSignDisplayin interfaceIsDefaultNumberFormatOptions- Returns:
- when to display the sign for the number
-
setStyle
public void setStyle(Style style)
Sets the formatting style to use.- Specified by:
setStylein interfaceIsNumberFormat- Parameters:
style- the formatting style to use
-
getStyle
public Style getStyle()
Returns the formatting style to use.- Specified by:
getStylein interfaceIsDefaultNumberFormatOptions- Returns:
- the formatting style to use
-
setUnitsOfMeasure
public 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.- Specified by:
setUnitsOfMeasurein interfaceIsNumberFormat- Parameters:
units- the units to use in units formatting
-
setUnitsOfMeasure
public 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.- Specified by:
setUnitsOfMeasurein interfaceIsNumberFormat- Parameters:
units- the units to use in units formatting
-
getUnitsOfMeasure
public List<MeasureUnit> getUnitsOfMeasure()
Returns an unmodifiable list of units to use in unit formatting.- Specified by:
getUnitsOfMeasurein interfaceIsDefaultNumberFormatOptions- Returns:
- an unmodifiable list of unit to use in unit formatting
-
setUnitOfMeasureDisplay
public void setUnitOfMeasureDisplay(MeasureUnitDisplay unitDisplay)
Sets the unit formatting style to use in unit formatting.- Specified by:
setUnitOfMeasureDisplayin interfaceIsNumberFormat- Parameters:
unitDisplay- the unit formatting style to use in unit formatting
-
getUnitOfMeasureDisplay
public MeasureUnitDisplay getUnitOfMeasureDisplay()
Returns the unit formatting style to use in unit formatting.- Specified by:
getUnitOfMeasureDisplayin interfaceIsDefaultNumberFormatOptions- Returns:
- the unit formatting style to use in unit formatting
-
setUseGrouping
public void setUseGrouping(boolean useGrouping)
Setstruewhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators.- Specified by:
setUseGroupingin interfaceIsNumberFormat- Parameters:
useGrouping-truewhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators
-
isUseGrouping
public boolean isUseGrouping()
Returnstruewhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators.- Specified by:
isUseGroupingin interfaceIsDefaultNumberFormatOptions- Returns:
truewhether to use grouping separators, such as thousands separators or thousand/lakh/crore separators
-
setMinimumIntegerDigits
public void setMinimumIntegerDigits(int minimumIntegerDigits)
Sets the minimum number of integer digits to use.
Possible values are from 1 to 21.- Specified by:
setMinimumIntegerDigitsin interfaceIsNumberFormat- Parameters:
minimumIntegerDigits- the minimum number of integer digits to use
-
getMinimumIntegerDigits
public int getMinimumIntegerDigits()
Returns the minimum number of integer digits to use.- Specified by:
getMinimumIntegerDigitsin interfaceIsDefaultNumberFormatOptions- Returns:
- the minimum number of integer digits to use
-
setMinimumFractionDigits
public void setMinimumFractionDigits(int minimumFractionDigits)
Sets the minimum number of fraction digits to use.
Possible values are from 0 to 20.- Specified by:
setMinimumFractionDigitsin interfaceIsNumberFormat- Parameters:
minimumFractionDigits- the minimum number of fraction digits to use
-
getMinimumFractionDigits
public 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 interfaceIsDefaultNumberFormatOptions- 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()
-
setMaximumFractionDigits
public void setMaximumFractionDigits(int maximumFractionDigits)
Sets the maximum number of fraction digits to use.
Possible values are from 0 to 20.- Specified by:
setMaximumFractionDigitsin interfaceIsNumberFormat- Parameters:
maximumFractionDigits- the maximum number of fraction digits to use
-
getMaximumFractionDigits
public int getMaximumFractionDigits()
Returns the maximum number of fraction digits to use.
The default for plain number formatting is the larger ofNumberFormatOptions.getMinimumFractionDigits()and 3.
The default for currency formatting is the larger ofNumberFormatOptions.getMinimumFractionDigits()and the number of minor unit digits provided by currency, seeCurrency.getMinimumFractionDigits().
The default for percent formatting is the larger ofNumberFormatOptions.getMinimumFractionDigits()and 0.- Specified by:
getMaximumFractionDigitsin interfaceIsDefaultNumberFormatOptions- Returns:
- the maximum number of fraction digits to use.
The default for plain number formatting is the larger ofNumberFormatOptions.getMinimumFractionDigits()and 3.
The default for currency formatting is the larger ofNumberFormatOptions.getMinimumFractionDigits()and the number of minor unit digits provided by currency, seeCurrency.getMinimumFractionDigits().
The default for percent formatting is the larger ofNumberFormatOptions.getMinimumFractionDigits()and 0.
-
setMinimumSignificantDigits
public void setMinimumSignificantDigits(int minimumIntegerDigits)
Sets the minimum number of significant digits to use.
Possible values are from 1 to 21.- Specified by:
setMinimumSignificantDigitsin interfaceIsNumberFormat- Parameters:
minimumIntegerDigits- the minimum number of significant digits to use
-
getMinimumSignificantDigits
public int getMinimumSignificantDigits()
Returns the minimum number of significant digits to use.- Specified by:
getMinimumSignificantDigitsin interfaceIsDefaultNumberFormatOptions- Returns:
- the minimum number of significant digits to use
-
setMaximumSignificantDigits
public void setMaximumSignificantDigits(int minimumIntegerDigits)
Sets the maximum number of significant digits to use.
Possible values are from 1 to 21.- Specified by:
setMaximumSignificantDigitsin interfaceIsNumberFormat- Parameters:
minimumIntegerDigits- the maximum number of significant digits to use
-
getMaximumSignificantDigits
public int getMaximumSignificantDigits()
Returns the maximum number of significant digits to use.- Specified by:
getMaximumSignificantDigitsin interfaceIsDefaultNumberFormatOptions- Returns:
- the maximum number of significant digits to use
-
-