- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- de.haumacher.msgbuf.util.ReferenceList<T>
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,RandomAccess
public abstract class ReferenceList<T> extends ArrayList<T>
Listimplementing a repeated property of a data object that has a reverse end.The reverse end must be handled in concrete subclasses by overriding
beforeAdd(int, Object)andafterRemove(int, Object).- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ReferenceList()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(int index, T element)booleanadd(T element)booleanaddAll(int index, Collection<? extends T> collection)booleanaddAll(Collection<? extends T> collection)protected abstract voidafterRemove(int index, T element)protected abstract voidbeforeAdd(int index, T element)voidclear()Tremove(int index)booleanremove(Object element)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)-
Methods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeIf, removeRange, replaceAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
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.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Method Detail
-
add
public void add(int index, T element)
-
add
public boolean add(T element)
-
addAll
public boolean addAll(Collection<? extends T> collection)
-
addAll
public boolean addAll(int index, Collection<? extends T> collection)
-
beforeAdd
protected abstract void beforeAdd(int index, T element)
-
remove
public T remove(int index)
-
remove
public boolean remove(Object element)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
clear
public void clear()
-
afterRemove
protected abstract void afterRemove(int index, T element)
-
-