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:
java.lang.Iterable, java.util.Collection, java.util.List

public class DataObjectList
extends java.util.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  java.util.List dataObjects
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DataObjectList()
           
DataObjectList(java.util.Collection dataObjects)
           
DataObjectList(java.util.Collection dataObjects, boolean typeCheck)
           
DataObjectList(int capacity)
           
 
Method Summary
 boolean add(DataObject dataObject)
           
 void add(int index, DataObject dataObject)
           
 void add(int index, java.lang.Object element)
           
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection dataObjects)
           
 boolean addAll(java.util.Collection dataObjects, boolean typeCheck)
           
 boolean addAll(int index, java.util.Collection c)
           
 boolean addAll(int index, java.util.Collection dataObjects, boolean typeCheck)
           
 void addDataObjectChangeListener(DataObjectChangeListener listener)
           
 void clear()
           
 void clearDataObjectChangeListeners()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection dataObjects)
           
 java.lang.Object get(int index)
           
 DataObject getDataObject(int index)
           
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
           
 int lastIndexOf(java.lang.Object o)
           
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection dataObjects)
           
 void removeDataObjectChangeListener(DataObjectChangeListener listener)
           
 boolean retainAll(java.util.Collection dataObjects)
           
 DataObject set(int index, DataObject dataObject)
           
 java.lang.Object set(int index, java.lang.Object element)
           
 int size()
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.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 java.util.List dataObjects

changeDispatcher

protected EventDispatcher changeDispatcher
Constructor Detail

DataObjectList

public DataObjectList()

DataObjectList

public DataObjectList(int capacity)

DataObjectList

public DataObjectList(java.util.Collection dataObjects,
                      boolean typeCheck)

DataObjectList

public DataObjectList(java.util.Collection dataObjects)
Method Detail

addDataObjectChangeListener

public void addDataObjectChangeListener(DataObjectChangeListener listener)

removeDataObjectChangeListener

public void removeDataObjectChangeListener(DataObjectChangeListener listener)

clearDataObjectChangeListeners

public void clearDataObjectChangeListeners()

indexOf

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

lastIndexOf

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

contains

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

isEmpty

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

size

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

add

public boolean add(DataObject dataObject)

add

public void add(int index,
                DataObject dataObject)

add

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

add

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

remove

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

remove

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

set

public DataObject set(int index,
                      DataObject dataObject)

set

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

get

public java.lang.Object get(int index)
Specified by:
get in interface java.util.List
Specified by:
get in class java.util.AbstractList

getDataObject

public DataObject getDataObject(int index)

toArray

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

toArray

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

clear

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

removeAll

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

containsAll

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

addAll

public boolean addAll(java.util.Collection dataObjects,
                      boolean typeCheck)

addAll

public boolean addAll(int index,
                      java.util.Collection dataObjects,
                      boolean typeCheck)

addAll

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

addAll

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

retainAll

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


Copyright © 2001-2006 Apache.org All Rights Reserved.