Eclipse Platform
Release 3.3

org.eclipse.core.databinding.observable.list
Class WritableList

java.lang.Object
  extended byorg.eclipse.core.databinding.observable.ChangeManager
      extended byorg.eclipse.core.databinding.observable.AbstractObservable
          extended byorg.eclipse.core.databinding.observable.list.ObservableList
              extended byorg.eclipse.core.databinding.observable.list.WritableList
All Implemented Interfaces:
Collection, IObservable, IObservableCollection, IObservableList, List

public class WritableList
extends ObservableList

Mutable observable list backed by an ArrayList.

This class is thread safe. All state accessing methods must be invoked from the current realm. Methods for adding and removing listeners may be invoked from any thread.

Since:
1.0

Field Summary
 
Fields inherited from class org.eclipse.core.databinding.observable.list.ObservableList
wrappedList
 
Constructor Summary
WritableList()
          Creates an empty writable list in the default realm with a null element type.
WritableList(List toWrap, Object elementType)
          Construts a new instance with the default realm.
WritableList(Realm realm)
          Creates an empty writable list with a null element type.
WritableList(Realm realm, List toWrap, Object elementType)
          Creates a writable list containing elements of the given type, wrapping an existing client-supplied list.
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object element)
           
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection c)
           
 void clear()
           
 Object remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 Object set(int index, Object element)
           
static WritableList withElementType(Object elementType)
           
 
Methods inherited from class org.eclipse.core.databinding.observable.list.ObservableList
addListChangeListener, contains, containsAll, dispose, equals, fireChange, fireListChange, get, getElementType, getterCalled, hashCode, indexOf, isEmpty, isStale, iterator, lastIndexOf, listIterator, listIterator, removeListChangeListener, setStale, size, subList, toArray, toArray, toString, updateWrappedList
 
Methods inherited from class org.eclipse.core.databinding.observable.AbstractObservable
addChangeListener, addListener, addStaleListener, checkRealm, fireEvent, fireStale, firstListenerAdded, getRealm, hasListeners, lastListenerRemoved, removeChangeListener, removeListener, removeStaleListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable
addChangeListener, addStaleListener, getRealm, removeChangeListener, removeStaleListener
 

Constructor Detail

WritableList

public WritableList()
Creates an empty writable list in the default realm with a null element type.


WritableList

public WritableList(Realm realm)
Creates an empty writable list with a null element type.

Parameters:
realm -

WritableList

public WritableList(List toWrap,
                    Object elementType)
Construts a new instance with the default realm.

Parameters:
toWrap -
elementType - can be null

WritableList

public WritableList(Realm realm,
                    List toWrap,
                    Object elementType)
Creates a writable list containing elements of the given type, wrapping an existing client-supplied list.

Parameters:
realm -
toWrap - The java.utilList to wrap
elementType - can be null
Method Detail

set

public Object set(int index,
                  Object element)
Specified by:
set in interface IObservableList
Overrides:
set in class ObservableList

remove

public Object remove(int index)
Specified by:
remove in interface IObservableList
Overrides:
remove in class ObservableList

add

public boolean add(Object element)
Specified by:
add in interface IObservableList
Overrides:
add in class ObservableList

add

public void add(int index,
                Object element)
Specified by:
add in interface List
Overrides:
add in class ObservableList

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface IObservableList
Overrides:
addAll in class ObservableList

addAll

public boolean addAll(int index,
                      Collection c)
Specified by:
addAll in interface IObservableList
Overrides:
addAll in class ObservableList

remove

public boolean remove(Object o)
Specified by:
remove in interface IObservableList
Overrides:
remove in class ObservableList

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface IObservableList
Overrides:
removeAll in class ObservableList

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface IObservableList
Overrides:
retainAll in class ObservableList

clear

public void clear()
Specified by:
clear in interface List
Overrides:
clear in class ObservableList

withElementType

public static WritableList withElementType(Object elementType)
Parameters:
elementType - can be null
Returns:
new list with the default realm.

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.