org.stjs.javascript
Interface Array<V>

All Superinterfaces:
Iterable<String>

public interface Array<V>
extends Iterable<String>

This interface represents an array from Javascript.The value may be typed. The iteration is done on the indexes to have the javascript equivalent of
for(var key in array)
The methods are prefixed with $ to let the generator know that is should generate braket access instead, i.e
array.$get(key) => array[key]
array.$set(key, value) => array[key]=value

Author:
acraciun

Method Summary
 V $get(int index)
           
 V $get(String index)
           
 int $length()
           
 void $length(int newLength)
           
 void $set(int index, V value)
           
 void $set(String index, V value)
           
 Array<V> concat(Array<V>... arrays)
           
 void forEach(Callback1<V> callback)
           
 int indexOf(V element)
           
 int indexOf(V element, int start)
           
 String join()
           
 String join(String separator)
           
 V pop()
           
 int push(V... values)
           
 void reverse()
           
 V shift()
           
 Array<V> slice(int start)
           
 Array<V> slice(int start, int end)
           
 void sort(SortFunction<V> function)
           
 Array<V> splice(int start)
           
 Array<V> splice(int start, int howMany)
           
 Array<V> splice(int start, int howMany, V... values)
           
 int unshift(V... values)
           
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

$get

V $get(int index)

$get

V $get(String index)

$set

void $set(int index,
          V value)

$set

void $set(String index,
          V value)

$length

int $length()

$length

void $length(int newLength)

concat

Array<V> concat(Array<V>... arrays)

indexOf

int indexOf(V element)

indexOf

int indexOf(V element,
            int start)

join

String join()

join

String join(String separator)

pop

V pop()

push

int push(V... values)

reverse

void reverse()

shift

V shift()

slice

Array<V> slice(int start)

slice

Array<V> slice(int start,
               int end)

splice

Array<V> splice(int start)

splice

Array<V> splice(int start,
                int howMany)

splice

Array<V> splice(int start,
                int howMany,
                V... values)

sort

void sort(SortFunction<V> function)

unshift

int unshift(V... values)

forEach

void forEach(Callback1<V> callback)


Copyright © 2012. All Rights Reserved.