Class Array
- java.lang.Object
-
- org.pepstock.charba.client.commons.Array
-
- All Implemented Interfaces:
IsJSType
- Direct Known Subclasses:
ArrayCanvas
,ArrayChart
,ArrayDouble
,ArrayDoubleArray
,ArrayGradient
,ArrayImage
,ArrayInteger
,ArrayMixedObject
,ArrayObject
,ArrayPattern
,ArrayString
,ArrayTouch
,RegExpResult
@JsType(isNative=true, name="Array", namespace="<global>") public abstract class Array extends Object implements IsJSType
Array object which maps the java script object.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description Array()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isArray(Object object)
This method determines whether the passed value is an Array.boolean
isEmpty()
Returnstrue
if this array contains no elements.String
join()
Creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by commas.
If the array has only one item, then that item will be returned without using the separator.String
join(String separator)
Creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by commas or a specified separator string.
If the array has only one item, then that item will be returned without using the separator.int
length()
Returns the number of elements in this array.
-
-
-
Method Detail
-
isArray
public static boolean isArray(Object object)
This method determines whether the passed value is an Array.- Parameters:
object
- object to be checked.- Returns:
true
if the value is an Array; otherwise,false
.
-
length
@JsProperty(name="length") public final int length()
Returns the number of elements in this array.- Returns:
- the number of elements in this array.
-
isEmpty
@JsOverlay public final boolean isEmpty()
Returnstrue
if this array contains no elements.- Returns:
true
if this array contains no elements
-
join
@JsOverlay public final String join()
Creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by commas.
If the array has only one item, then that item will be returned without using the separator.- Returns:
- a new string by concatenating all of the elements in an array
-
join
@JsOverlay public final String join(String separator)
Creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by commas or a specified separator string.
If the array has only one item, then that item will be returned without using the separator.- Parameters:
separator
- separator string to apply in the join- Returns:
- a new string by concatenating all of the elements in an array
-
-