E - Type of the elements in this set.public final class ScopedSet<E> extends java.lang.Object implements ScopeSubscriber, java.util.Set<E>
Set which is scope aware.
This enables the user to store in a set and retrieve these values without taking care about scope changes. The values are always scope aware.
| Constructor and Description |
|---|
ScopedSet(ScopeObserver scopeObserver)
Constructs a new object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E e) |
boolean |
addAll(java.util.Collection<? extends E> c) |
void |
addScopedSetObserver(ScopedSetObserver<E> obs)
Adds the given observer to the list of known observers.
|
void |
clear() |
void |
close()
Unsubscribe this scoped container from the
ScopePublisher. |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
void |
enterScope(Scope previous,
Scope next)
The application has entered the
next scope and the
previous scope is no more the current scope. |
void |
exitScope(Scope previous,
Scope next)
The application has left the
previous scope and the
next scope is valid. |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
void |
removeScopedSetObserver(ScopedSetObserver<E> obs)
Removes the given scope observer from the list of known observers.
|
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
public ScopedSet(ScopeObserver scopeObserver)
scopeObserver - The current scope observer.public void addScopedSetObserver(ScopedSetObserver<E> obs)
obs - the observer to addpublic void removeScopedSetObserver(ScopedSetObserver<E> obs)
obs - the observer to removepublic void close()
ScopePublisher.public void enterScope(Scope previous, Scope next)
next scope and the
previous scope is no more the current scope.enterScope in interface ScopeSubscriberprevious - the old scope.next - The new scope.public void exitScope(Scope previous, Scope next)
previous scope and the
next scope is valid.exitScope in interface ScopeSubscriberprevious - the old scope.next - the new scope.public boolean add(E e)
public boolean addAll(java.util.Collection<? extends E> c)
public void clear()
public boolean contains(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public boolean isEmpty()
public java.util.Iterator<E> iterator()
public boolean remove(java.lang.Object o)
public boolean removeAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public int size()
public java.lang.Object[] toArray()