org.decisiondeck.utils.collections
Class AbstractSetView<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<T>
org.decisiondeck.utils.collections.AbstractSetView<T>
- Type Parameters:
T - the type of the objects in the set view and the underlying set.
- All Implemented Interfaces:
- Iterable<T>, Collection<T>, Set<T>
public abstract class AbstractSetView<T>
- extends AbstractSet<T>
- implements Set<T>
A set view that wraps an other set. When the user calls {#remove(Object)} on this view, if the underlying set
contains the object, this view calls first beforeRemove(Object), then justRemove(Object), then
afterRemove(Object). Extenders of this view may override the methods to do appropriate job before or after
removal. When an iterator is asked on this view, and the iterator remove method is used, this view first calls
beforeRemove(Object), then removes the object using the iterator method, then calls
afterRemove(Object).
AbstractSetView
public AbstractSetView(Set<T> delegateSet)
- Parameters:
delegateSet - not null.
add
public boolean add(T e)
- Specified by:
add in interface Collection<T>- Specified by:
add in interface Set<T>- Overrides:
add in class AbstractCollection<T>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<T>- Specified by:
remove in interface Set<T>- Overrides:
remove in class AbstractCollection<T>
contains
public boolean contains(Object c)
- Specified by:
contains in interface Collection<T>- Specified by:
contains in interface Set<T>- Overrides:
contains in class AbstractCollection<T>
iterator
public Iterator<T> iterator()
- Specified by:
iterator in interface Iterable<T>- Specified by:
iterator in interface Collection<T>- Specified by:
iterator in interface Set<T>- Specified by:
iterator in class AbstractCollection<T>
size
public int size()
- Specified by:
size in interface Collection<T>- Specified by:
size in interface Set<T>- Specified by:
size in class AbstractCollection<T>
Copyright © 2011. All Rights Reserved.