E
- the type of elements in this setpublic abstract class ProxiedSet<E> extends ProxiedCollection<E> implements Set<E>
Set
implementation pointing to a given set object.
Therefore it allows implementing sets based on invisible set types, such as
Collections.unmodifiableSet(Set)
or
Collections.synchronizedSet(Set)
.
Modifier | Constructor and Description |
---|---|
protected |
ProxiedSet(Set<E> set)
An abstract
Set implementation pointing to set . |
Modifier and Type | Method and Description |
---|---|
protected Set<E> |
getWrappedForRead()
Returns the wrapped collection without verifying if modifying it is
prohibited.
|
protected Set<E> |
getWrappedIfModifiable()
Verifies if this object is modifiable and either returns the wrapped
collection or throws an appropriate exception.
|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, isModifiable, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
parallelStream, removeIf, stream
protected ProxiedSet(Set<E> set)
Set
implementation pointing to set
.
Therefore it allows implementing sets based on invisible set types, such as
Collections.unmodifiableSet(Set)
or
Collections.synchronizedSet(Set)
.
set
- the set to proxyprotected Set<E> getWrappedIfModifiable()
getWrappedIfModifiable
in class ProxiedCollection<E>
protected Set<E> getWrappedForRead()
getWrappedForRead
in class ProxiedCollection<E>
Copyright © 2025. All rights reserved.