T
- the Type of the object to put into the arraypublic class JsLightArray<T> extends Object implements LightArray<T>
LightArray
, which makes direct use of native
javascript arraysConstructor and Description |
---|
JsLightArray()
Construct a
JsLightArray |
JsLightArray(com.google.gwt.core.client.JavaScriptObject array)
Construct a
JsLightArray with a given javascript array |
Modifier and Type | Method and Description |
---|---|
T |
get(int index)
get the object at a specific index
|
com.google.gwt.core.client.JavaScriptObject |
getArray()
returns the underlying javascript array
|
int |
length()
the length of the array
|
void |
push(T value)
push a value on to the array
|
void |
set(int index,
T value)
put an object to a given index. the array autoexpands and fills up missing values with null
|
T |
shift()
pop a value from the array
|
void |
unshift(T value)
push a value onto the array
|
public JsLightArray()
JsLightArray
public JsLightArray(com.google.gwt.core.client.JavaScriptObject array)
JsLightArray
with a given javascript arrayarray
- the array to usepublic T get(int index)
LightArray
get
in interface LightArray<T>
index
- the indexpublic com.google.gwt.core.client.JavaScriptObject getArray()
public int length()
LightArray
length
in interface LightArray<T>
public void push(T value)
LightArray
push
in interface LightArray<T>
public void set(int index, T value)
LightArray
set
in interface LightArray<T>
index
- the indexvalue
- the value to storepublic T shift()
LightArray
shift
in interface LightArray<T>
public void unshift(T value)
LightArray
unshift
in interface LightArray<T>
value
- to pushCopyright © 2019 Magnolia International Ltd.. All rights reserved.