org.apache.cayenne.dataview
Class DataObjectList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.apache.cayenne.dataview.DataObjectList
All Implemented Interfaces:
Iterable, Collection, List

public class DataObjectList
extends AbstractList

A decorator list for a collection of DataObjects that fires DataObjectChangeEventevents on modification, and supports registering DataObjectChangeListenersto recieve these events. Designed to be used as an active model in Swing applications.

Since:
1.1
Author:
Andriy Shapochka

Field Summary
protected  EventDispatcher changeDispatcher
           
protected  List dataObjects
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DataObjectList()
           
DataObjectList(Collection dataObjects)
           
DataObjectList(Collection dataObjects, boolean typeCheck)
           
DataObjectList(int capacity)
           
 
Method Summary
 boolean add(DataObject dataObject)
           
 void add(int index, DataObject dataObject)
           
 void add(int index, Object element)
           
 boolean add(Object o)
           
 boolean addAll(Collection dataObjects)
           
 boolean addAll(Collection dataObjects, boolean typeCheck)
           
 boolean addAll(int index, Collection c)
           
 boolean addAll(int index, Collection dataObjects, boolean typeCheck)
           
 void addDataObjectChangeListener(DataObjectChangeListener listener)
           
 void clear()
           
 void clearDataObjectChangeListeners()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection dataObjects)
           
 Object get(int index)
           
 DataObject getDataObject(int index)
           
 int indexOf(Object o)
           
 boolean isEmpty()
           
 int lastIndexOf(Object o)
           
 Object remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection dataObjects)
           
 void removeDataObjectChangeListener(DataObjectChangeListener listener)
           
 boolean retainAll(Collection dataObjects)
           
 DataObject set(int index, DataObject dataObject)
           
 Object set(int index, Object element)
           
 int size()
           
 Object[] toArray()
           
 Object[] toArray(Object[] array)
           
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dataObjects

protected List dataObjects

changeDispatcher

protected EventDispatcher changeDispatcher
Constructor Detail

DataObjectList

public DataObjectList()

DataObjectList

public DataObjectList(int capacity)

DataObjectList

public DataObjectList(Collection dataObjects,
                      boolean typeCheck)

DataObjectList

public DataObjectList(Collection dataObjects)
Method Detail

addDataObjectChangeListener

public void addDataObjectChangeListener(DataObjectChangeListener listener)

removeDataObjectChangeListener

public void removeDataObjectChangeListener(DataObjectChangeListener listener)

clearDataObjectChangeListeners

public void clearDataObjectChangeListeners()

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List
Overrides:
indexOf in class AbstractList

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List
Overrides:
lastIndexOf in class AbstractList

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface List
Overrides:
contains in class AbstractCollection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface List
Overrides:
isEmpty in class AbstractCollection

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection

add

public boolean add(DataObject dataObject)

add

public void add(int index,
                DataObject dataObject)

add

public boolean add(Object o)
Specified by:
add in interface Collection
Specified by:
add in interface List
Overrides:
add in class AbstractList

add

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

remove

public Object remove(int index)
Specified by:
remove in interface List
Overrides:
remove in class AbstractList

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface List
Overrides:
remove in class AbstractCollection

set

public DataObject set(int index,
                      DataObject dataObject)

set

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

get

public Object get(int index)
Specified by:
get in interface List
Specified by:
get in class AbstractList

getDataObject

public DataObject getDataObject(int index)

toArray

public Object[] toArray(Object[] array)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class AbstractCollection

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class AbstractCollection

clear

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

removeAll

public boolean removeAll(Collection dataObjects)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List
Overrides:
removeAll in class AbstractCollection

containsAll

public boolean containsAll(Collection dataObjects)
Specified by:
containsAll in interface Collection
Specified by:
containsAll in interface List
Overrides:
containsAll in class AbstractCollection

addAll

public boolean addAll(Collection dataObjects,
                      boolean typeCheck)

addAll

public boolean addAll(int index,
                      Collection dataObjects,
                      boolean typeCheck)

addAll

public boolean addAll(Collection dataObjects)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List
Overrides:
addAll in class AbstractCollection

addAll

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

retainAll

public boolean retainAll(Collection dataObjects)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List
Overrides:
retainAll in class AbstractCollection


Copyright © 2001-2007 Apache Cayenne. All Rights Reserved.