public class MVCArray extends JavascriptObject
jsObject, objectCounter, peerRegistry, runtime, variableName
Constructor and Description |
---|
MVCArray() |
MVCArray(netscape.javascript.JSObject obj) |
MVCArray(Object[] ary) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all elements from the array.
|
void |
forEach(String func)
Iterates over the elements within the array, calling the supplied
function for each member.
|
netscape.javascript.JSObject |
getArray()
Returns a JSObject representing the underlying array.
|
netscape.javascript.JSObject |
getAt(int idx)
Returns the item at the specified index in the array.
|
int |
getLength()
Gets the length of the array.
|
void |
insertAt(int idx,
JavascriptObject elem)
Inserts the supplied element at the specified index in the array.
|
netscape.javascript.JSObject |
pop()
Removes and returns the last element of the array
|
int |
push(JavascriptObject obj)
Adds the supplied element onto the end of the array, then returns the
length of the array.
|
void |
removeAt(int idx)
Removes and discards the item at the specified index.
|
void |
setAt(int idx,
JavascriptObject obj)
Sets the supplied object at the supplied index.
|
checkBoolean, checkInteger, checkUndefined, getJSObject, getNextVariableName, getProperty, getProperty, getVariableName, invokeJavascript, invokeJavascript, invokeJavascriptReturnValue, invokeJavascriptReturnValue, isMemberDefined, setProperty, setProperty, setProperty
public MVCArray()
public MVCArray(Object[] ary)
public MVCArray(netscape.javascript.JSObject obj)
public void clear()
public void forEach(String func)
func
- public netscape.javascript.JSObject getArray()
public netscape.javascript.JSObject getAt(int idx)
idx
- The index of the item to be returned.public int getLength()
public void insertAt(int idx, JavascriptObject elem)
idx
- The index at which to insert the item.elem
- The item to be inserted.public netscape.javascript.JSObject pop()
public int push(JavascriptObject obj)
obj
- The Javascript object to be added to the array.public void removeAt(int idx)
idx
- The index of the object to be removed.public void setAt(int idx, JavascriptObject obj)
idx
- The index at which the item should be set.obj
- The object to be set at the supplied index.Copyright © 2016. All Rights Reserved.