com.google.gwt.maps.jsio.client.impl
Class JSListWrapper<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<T>
          extended by com.google.gwt.maps.jsio.client.impl.AbstractJSListWrapper<T>
              extended by com.google.gwt.maps.jsio.client.impl.JSListWrapper<T>
Type Parameters:
T - the type of object stored in the list
All Implemented Interfaces:
JSList<T>, JSWrapper<JSListWrapper<T>>, java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>

public final class JSListWrapper<T>
extends AbstractJSListWrapper<T>
implements JSList<T>, JSWrapper<JSListWrapper<T>>

This an implementation of List that operates directly on JS arrays of objects that can be made into JavaScriptObjects.


Field Summary
 
Fields inherited from class com.google.gwt.maps.jsio.client.impl.AbstractJSListWrapper
arr
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
JSListWrapper(Extractor<T> extractor)
           
 
Method Summary
 void add(int index, T object)
           
static
<T> JSListWrapper<T>
create(Extractor<T> e)
          Used by JSNI code to construct new JSListWrappers.
static
<T> com.google.gwt.maps.jsio.client.impl.JSListWrapper.WrappingExtractor<T>
createExtractor(Extractor<T> e)
           
 T get(int index)
           
 com.google.gwt.maps.jsio.client.impl.JSListWrapper.WrappingExtractor<T> getExtractor()
          Used by JSList.
 T remove(int index)
           
 T set(int index, T o)
           
 JSListWrapper<T> setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject obj)
          Convenience setter for generated subclasses to be able to initialize newly-created instances without another parsing cycle.
 
Methods inherited from class com.google.gwt.maps.jsio.client.impl.AbstractJSListWrapper
clear, getJavaScriptObject, removeRange, setJSONData, size, sizeNative, splice, splice
 
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, size, subList, toArray, toArray
 
Methods inherited from interface com.google.gwt.maps.jsio.client.JSWrapper
getJavaScriptObject, setJSONData
 

Constructor Detail

JSListWrapper

public JSListWrapper(Extractor<T> extractor)
Method Detail

create

public static <T> JSListWrapper<T> create(Extractor<T> e)
Used by JSNI code to construct new JSListWrappers.


createExtractor

public static <T> com.google.gwt.maps.jsio.client.impl.JSListWrapper.WrappingExtractor<T> createExtractor(Extractor<T> e)

add

public void add(int index,
                T object)
Specified by:
add in interface java.util.List<T>
Overrides:
add in class java.util.AbstractList<T>

get

public T get(int index)
Specified by:
get in interface java.util.List<T>
Specified by:
get in class java.util.AbstractList<T>

getExtractor

public com.google.gwt.maps.jsio.client.impl.JSListWrapper.WrappingExtractor<T> getExtractor()
Description copied from interface: JSWrapper
Used by JSList.

Specified by:
getExtractor in interface JSWrapper<JSListWrapper<T>>

remove

public T remove(int index)
Specified by:
remove in interface java.util.List<T>
Overrides:
remove in class java.util.AbstractList<T>

set

public T set(int index,
             T o)
Specified by:
set in interface java.util.List<T>
Overrides:
set in class java.util.AbstractList<T>

setJavaScriptObject

public JSListWrapper<T> setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject obj)
Convenience setter for generated subclasses to be able to initialize newly-created instances without another parsing cycle. This is intentionally not exposed via JSWrapper to prevent the backing JSONObject from changing out from under the wrapper.

Specified by:
setJavaScriptObject in interface JSWrapper<JSListWrapper<T>>
Returns:
the instance of the JSWrapper.