|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.ArrayList blackboard.base.SharableArrayList blackboard.base.BbList blackboard.base.BbDeleteTrackingList
public class BbDeleteTrackingList
An extension of BbList
that maintains a tracking set of elements that have been
removed through one mechanism or another. Useful within the persistence framework to track
child objects attached to heavyweight objects, and delete them as needed.
For instance, imagine a class Foo, containing an array of Bar objects. When a Foo instance is loaded, and then one of the Bar elements is removed from its list, it would be difficult to update the database to reflect the deletion of that object. Now, however, a call to getDeletedElements() returns a complete set of elements unlinked one way or another.
Note: This class is typically for Blackboard-only use and should be considered unstable.
List
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class blackboard.base.BbList |
---|
BbList.Iterator |
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
BbDeleteTrackingList()
Default Constructor. |
|
BbDeleteTrackingList(java.lang.Class typeClass)
Constructs a BbList designated to only accept objects that are instances of the
object represented by the provided Class value for addition to the list. |
Method Summary | |
---|---|
void |
add(int index,
java.lang.Object element)
Inserts the specified element at the specified position in this list. |
boolean |
add(java.lang.Object o)
Appends the specified element to this list. |
boolean |
addAll(java.util.Collection c)
Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator. |
boolean |
addAll(int index,
java.util.Collection c)
Inserts all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator. |
void |
clear()
Removes all of the elements from this list. |
java.util.Collection |
getDeletedElements()
Returns a collection of all elements removed through one mechanism or another. |
java.lang.Object |
remove(int index)
Removes the element at the specified position in this list. |
boolean |
remove(java.lang.Object o)
Removes a single instance of the specified element from this collection, if it is present. |
boolean |
removeAll(java.util.Collection c)
Removes from this list all the elements that are contained in the specified collection. |
boolean |
retainAll(java.util.Collection c)
Retains only the elements in this list that are not contained in the specified collection. |
java.lang.Object |
set(int index,
java.lang.Object element)
Replaces the element at the specified position in this list with the specified element. |
Methods inherited from class blackboard.base.BbList |
---|
getFilteredSubList, getFilteringIterator, getFilteringIterator |
Methods inherited from class blackboard.base.SharableArrayList |
---|
debug, getSubList, trimList |
Methods inherited from class java.util.ArrayList |
---|
clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, removeRange, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, subList |
Constructor Detail |
---|
public BbDeleteTrackingList()
public BbDeleteTrackingList(java.lang.Class typeClass)
BbList
designated to only accept objects that are instances of the
object represented by the provided Class
value for addition to the list. Any
attempt to add objects of a different type will result in an exception being thrown.
An example declaration of a BbList
designed to only contain object of type
Integer
:
BbList list = new BbList( Integer.class ); list.add( new Integer( 1 ) ); <-- successful list.add( new Float( 1.0 ) ); <-- throws IllegalArgumentException
typeClass
- An instance of Class
that represents the type of object that can be
added to the listMethod Detail |
---|
public void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class BbList
index
- The index at which the specified element is to be insertedelement
- The element to be inserted
java.lang.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || index > size())
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in interface java.util.List
add
in class BbList
o
- The object to be addedpublic boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class java.util.ArrayList
c
- The collection to be addedpublic boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in class java.util.ArrayList
index
- The index at which the specified collection is to be insertedc
- The collection to be added
java.lang.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || index > size())
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class java.util.ArrayList
public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class java.util.ArrayList
index
- The index of the element to be removed
java.lang.IndexOutOfBoundsException
- If the index is out of range
(index < 0 || index > size())
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in class java.util.ArrayList
o
- The element to be removed from the collection, if present
true
If the collection contained the specified element
java.lang.UnsupportedOperationException
- If the remove
method is not supported by
this collectionpublic boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
removeAll
in class java.util.AbstractCollection
c
- The collection that defines which elements will be removedpublic boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
retainAll
in class java.util.AbstractCollection
c
- The collection that defines which elements will be retainedpublic java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
set
in class BbList
index
- The index of the element to replaceelement
- The element to be stored at the specified position
java.lang.IndexOutOfBoundsException
- if index out of range
(index < 0 || index >= size())
public java.util.Collection getDeletedElements()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |