Package org.mozilla.javascript
Class NativeMath
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.mozilla.javascript.IdScriptableObject
-
- org.mozilla.javascript.NativeMath
-
- All Implemented Interfaces:
java.io.Serializable
,ConstProperties
,DebuggableObject
,IdFunctionCall
,Scriptable
,SymbolScriptable
final class NativeMath extends IdScriptableObject
This class implements the Math native object. See ECMA 15.8.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.Double
Double32
private static int
Id_abs
private static int
Id_acos
private static int
Id_acosh
private static int
Id_asin
private static int
Id_asinh
private static int
Id_atan
private static int
Id_atan2
private static int
Id_atanh
private static int
Id_cbrt
private static int
Id_ceil
private static int
Id_clz32
private static int
Id_cos
private static int
Id_cosh
private static int
Id_E
private static int
Id_exp
private static int
Id_expm1
private static int
Id_floor
private static int
Id_fround
private static int
Id_hypot
private static int
Id_imul
private static int
Id_LN10
private static int
Id_LN2
private static int
Id_log
private static int
Id_log10
private static int
Id_LOG10E
private static int
Id_log1p
private static int
Id_log2
private static int
Id_LOG2E
private static int
Id_max
private static int
Id_min
private static int
Id_PI
private static int
Id_pow
private static int
Id_random
private static int
Id_round
private static int
Id_sign
private static int
Id_sin
private static int
Id_sinh
private static int
Id_sqrt
private static int
Id_SQRT1_2
private static int
Id_SQRT2
private static int
Id_tan
private static int
Id_tanh
private static int
Id_toSource
private static int
Id_trunc
private static int
LAST_METHOD_ID
private static double
LOG2E
private static java.lang.Object
MATH_TAG
private static int
MAX_ID
private static long
serialVersionUID
-
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
-
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
-
-
Constructor Summary
Constructors Modifier Constructor Description private
NativeMath()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.protected int
findPrototypeId(java.lang.String s)
java.lang.String
getClassName()
Return the name of the class.(package private) static void
init(Scriptable scope, boolean sealed)
protected void
initPrototypeId(int id)
private static double
js_hypot(java.lang.Object[] args)
private static int
js_imul(java.lang.Object[] args)
private static double
js_pow(double x, double y)
private static double
js_trunc(double d)
-
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findInstanceIdInfo, findPrototypeId, get, get, getAttributes, getAttributes, getIds, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, getOwnPropertyDescriptor, has, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes, setInstanceIdAttributes, setInstanceIdValue
-
Methods inherited from class org.mozilla.javascript.ScriptableObject
addLazilyInitializedValue, applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildClassCtor, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, checkValidAttributes, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
MATH_TAG
private static final java.lang.Object MATH_TAG
-
LOG2E
private static final double LOG2E
- See Also:
- Constant Field Values
-
Double32
private static final java.lang.Double Double32
-
Id_toSource
private static final int Id_toSource
- See Also:
- Constant Field Values
-
Id_abs
private static final int Id_abs
- See Also:
- Constant Field Values
-
Id_acos
private static final int Id_acos
- See Also:
- Constant Field Values
-
Id_asin
private static final int Id_asin
- See Also:
- Constant Field Values
-
Id_atan
private static final int Id_atan
- See Also:
- Constant Field Values
-
Id_atan2
private static final int Id_atan2
- See Also:
- Constant Field Values
-
Id_ceil
private static final int Id_ceil
- See Also:
- Constant Field Values
-
Id_cos
private static final int Id_cos
- See Also:
- Constant Field Values
-
Id_exp
private static final int Id_exp
- See Also:
- Constant Field Values
-
Id_floor
private static final int Id_floor
- See Also:
- Constant Field Values
-
Id_log
private static final int Id_log
- See Also:
- Constant Field Values
-
Id_max
private static final int Id_max
- See Also:
- Constant Field Values
-
Id_min
private static final int Id_min
- See Also:
- Constant Field Values
-
Id_pow
private static final int Id_pow
- See Also:
- Constant Field Values
-
Id_random
private static final int Id_random
- See Also:
- Constant Field Values
-
Id_round
private static final int Id_round
- See Also:
- Constant Field Values
-
Id_sin
private static final int Id_sin
- See Also:
- Constant Field Values
-
Id_sqrt
private static final int Id_sqrt
- See Also:
- Constant Field Values
-
Id_tan
private static final int Id_tan
- See Also:
- Constant Field Values
-
Id_cbrt
private static final int Id_cbrt
- See Also:
- Constant Field Values
-
Id_cosh
private static final int Id_cosh
- See Also:
- Constant Field Values
-
Id_expm1
private static final int Id_expm1
- See Also:
- Constant Field Values
-
Id_hypot
private static final int Id_hypot
- See Also:
- Constant Field Values
-
Id_log1p
private static final int Id_log1p
- See Also:
- Constant Field Values
-
Id_log10
private static final int Id_log10
- See Also:
- Constant Field Values
-
Id_sinh
private static final int Id_sinh
- See Also:
- Constant Field Values
-
Id_tanh
private static final int Id_tanh
- See Also:
- Constant Field Values
-
Id_imul
private static final int Id_imul
- See Also:
- Constant Field Values
-
Id_trunc
private static final int Id_trunc
- See Also:
- Constant Field Values
-
Id_acosh
private static final int Id_acosh
- See Also:
- Constant Field Values
-
Id_asinh
private static final int Id_asinh
- See Also:
- Constant Field Values
-
Id_atanh
private static final int Id_atanh
- See Also:
- Constant Field Values
-
Id_sign
private static final int Id_sign
- See Also:
- Constant Field Values
-
Id_log2
private static final int Id_log2
- See Also:
- Constant Field Values
-
Id_fround
private static final int Id_fround
- See Also:
- Constant Field Values
-
Id_clz32
private static final int Id_clz32
- See Also:
- Constant Field Values
-
LAST_METHOD_ID
private static final int LAST_METHOD_ID
- See Also:
- Constant Field Values
-
Id_E
private static final int Id_E
- See Also:
- Constant Field Values
-
Id_PI
private static final int Id_PI
- See Also:
- Constant Field Values
-
Id_LN10
private static final int Id_LN10
- See Also:
- Constant Field Values
-
Id_LN2
private static final int Id_LN2
- See Also:
- Constant Field Values
-
Id_LOG2E
private static final int Id_LOG2E
- See Also:
- Constant Field Values
-
Id_LOG10E
private static final int Id_LOG10E
- See Also:
- Constant Field Values
-
Id_SQRT1_2
private static final int Id_SQRT1_2
- See Also:
- Constant Field Values
-
Id_SQRT2
private static final int Id_SQRT2
- See Also:
- Constant Field Values
-
MAX_ID
private static final int MAX_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
static void init(Scriptable scope, boolean sealed)
-
getClassName
public java.lang.String getClassName()
Description copied from class:ScriptableObject
Return the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassName
in interfaceScriptable
- Specified by:
getClassName
in classScriptableObject
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeId
in classIdScriptableObject
-
execIdCall
public java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
Description copied from class:IdScriptableObject
'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.- Specified by:
execIdCall
in interfaceIdFunctionCall
- Overrides:
execIdCall
in classIdScriptableObject
-
js_pow
private static double js_pow(double x, double y)
-
js_hypot
private static double js_hypot(java.lang.Object[] args)
-
js_trunc
private static double js_trunc(double d)
-
js_imul
private static int js_imul(java.lang.Object[] args)
-
findPrototypeId
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeId
in classIdScriptableObject
-
-