java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.intl.NumberFormat
- All Implemented Interfaces:
Serializable,Cloneable,org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.debug.DebuggableObject,org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.Scriptable,org.htmlunit.corejs.javascript.SymbolScriptable
A JavaScript object for Intl.NumberFormat.
- Author:
- Ahmed Ashour, Ronald Brill, Lai Quang Duong
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction -
Field Summary
FieldsFields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, LEGACY_CONST, PERMANENT, READONLY, STRICTLY_READONLY, UNINITIALIZED_CONSTFields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
isSealedFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatRange(Object start, Object end) Formats a range of numbers.org.htmlunit.corejs.javascript.ScriptableformatRangeToParts(Object start, Object end) Formats a range of numbers into parts.org.htmlunit.corejs.javascript.ScriptableformatToParts(Object value) Formats a number into parts.getDefaultValue(Class<?> hint) Returns the JavaScript default value of this object.org.htmlunit.corejs.javascript.FunctionReturns the format function of this number format; the function is bound to this number format and formats a number according to the locale and the options.static org.htmlunit.corejs.javascript.ScriptablejsConstructor(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, Object[] args, org.htmlunit.corejs.javascript.Function ctorObj, boolean inNewExpr) JavaScript constructor.org.htmlunit.corejs.javascript.ScriptableReturns the resolved options for this Intl.NumberFormat object.static org.htmlunit.corejs.javascript.ScriptablesupportedLocalesOf(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj) Returns an array containing those of the provided locales that are supported without having to fall back to the default locale.Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, createDOMException, equivalentValues, get, getBrowserVersion, getClassName, getDomNodeOrDie, getDomNodeOrNull, getIds, getIndexedPropertyCount, getOwnPropertyDescriptor, getPrototype, getScriptableFor, getWindow, getWindow, getWindowOrWorkerGlobalScope, getWithPreemption, has, hasInstance, isIndexedPropertyWritable, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setupPromise, setupRejectedPromiseMethods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, sizeMethods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, createSlotMap, defineProperty, defineProperty, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMapsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.htmlunit.corejs.javascript.Scriptable
get, getIds, has, hasMethods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable
get, has
-
Field Details
-
TO_STRING_TAG
Symbol.toStringTag support.- See Also:
-
-
Constructor Details
-
NumberFormat
public NumberFormat()Default constructor.
-
-
Method Details
-
jsConstructor
public static org.htmlunit.corejs.javascript.Scriptable jsConstructor(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, Object[] args, org.htmlunit.corejs.javascript.Function ctorObj, boolean inNewExpr) JavaScript constructor.- Parameters:
cx- the current contextscope- the scopeargs- the arguments to the NumberFormat constructorctorObj- the function objectinNewExpr-trueif invoked with thenewoperator- Returns:
- the Java object that JavaScript can access
- See Also:
-
getFormat
public org.htmlunit.corejs.javascript.Function getFormat()Returns the format function of this number format; the function is bound to this number format and formats a number according to the locale and the options.- Returns:
- the format function
-
formatToParts
Formats a number into parts.- Parameters:
value- the number- Returns:
- an array of objects with the type and the value of the parts
- See Also:
-
formatRange
Formats a range of numbers.- Parameters:
start- the start of the rangeend- the end of the range- Returns:
- the formatted range
- See Also:
-
formatRangeToParts
Formats a range of numbers into parts.- Parameters:
start- the start of the rangeend- the end of the range- Returns:
- an array of objects with the type, the value and the source of the parts
- See Also:
-
resolvedOptions
public org.htmlunit.corejs.javascript.Scriptable resolvedOptions()Returns the resolved options for this Intl.NumberFormat object.- Returns:
- a new object with properties reflecting the locale and number formatting options
computed during the initialization of the given
NumberFormatobject.
-
supportedLocalesOf
public static org.htmlunit.corejs.javascript.Scriptable supportedLocalesOf(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj) Returns an array containing those of the provided locales that are supported without having to fall back to the default locale.- Parameters:
cx- the current contextscope- the scopethisObj- the scriptable thisargs- the arguments; a string with a BCP 47 language tag or an array of such strings and the options (unused)funObj- the function object- Returns:
- an array containing supported locales
-
getDefaultValue
Description copied from class:HtmlUnitScriptableReturns the JavaScript default value of this object. This is the JavaScript equivalent of a toString() in Java.- Specified by:
getDefaultValuein interfaceorg.htmlunit.corejs.javascript.Scriptable- Overrides:
getDefaultValuein classHtmlUnitScriptable- Parameters:
hint- a hint as to the format of the default value (ignored in this case)- Returns:
- the default value
-