Class ArrayDouble
- java.lang.Object
-
- org.pepstock.charba.client.commons.Array
-
- org.pepstock.charba.client.commons.ArrayDouble
-
- All Implemented Interfaces:
IsJSType
@JsType(isNative=true, name="Array", namespace="<global>") public final class ArrayDouble extends Array
Array object which maps the java script object.
A simple wrapper around a homogeneous native array of numeric (doubles) values.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ArrayDouble
fromOrEmpty(double... items)
This method creates new array instance with a variable number ofdouble
arguments.static ArrayDouble
fromOrEmpty(List<Double> items)
Creates a java script array of doubles starting from list of doubles.static ArrayDouble
fromOrNull(double... items)
This method creates new array instance with a variable number ofdouble
arguments.static ArrayDouble
fromOrNull(List<Double> items)
Creates a java script array of doubles starting from list of doubles.double
get(int index)
Gets the value at a given index.
-
-
-
Method Detail
-
fromOrNull
@JsOverlay public static ArrayDouble fromOrNull(double... items)
This method creates new array instance with a variable number ofdouble
arguments.- Parameters:
items
- double items to create new array- Returns:
- new array instance of doubles or
null
if argument isnull
or length to 0.
-
fromOrEmpty
@JsOverlay public static ArrayDouble fromOrEmpty(double... items)
This method creates new array instance with a variable number ofdouble
arguments.- Parameters:
items
- double items to create new array- Returns:
- new array instance of doubles or an empty array if argument is
null
or length to 0
-
fromOrNull
@JsOverlay public static ArrayDouble fromOrNull(List<Double> items)
Creates a java script array of doubles starting from list of doubles.- Parameters:
items
- list of doubles to load in the new java script array.- Returns:
- new array instance of doubles or
null
if argument isnull
or empty
-
fromOrEmpty
@JsOverlay public static ArrayDouble fromOrEmpty(List<Double> items)
Creates a java script array of doubles starting from list of doubles.- Parameters:
items
- list of doubles to load in the new java script array.- Returns:
- new array instance of doubles or an empty array if argument is
null
or empty
-
get
@JsOverlay public double get(int index)
Gets the value at a given index. If no value exists at the given index, a type-conversion error will occur in Development Mode and unpredictable behavior may occur in Production Mode. If the numeric value returned is non-integral, it will cause a warning in Development Mode, and may affect the results of mathematical expressions.- Parameters:
index
- the index to be retrieved- Returns:
- the value at the given index
-
-