public class ForwardingImmutableSet<E> extends Object implements Set<E>
Set
which cannot be modified once built.
WARNING: A malicious/careless client can still extend this class and override the methods that mutate
the object, which in this implementation throw UnsupportedOperationException
. Therefore this class
can at best be considered conditionally thread safe. To provide more robust protection, child classes should be
declared final
.
Created by QuijadaJ on 5/25/2017.Constructor and Description |
---|
ForwardingImmutableSet(Set<? extends E> pSet) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E s) |
boolean |
addAll(Collection<? extends E> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode, spliterator
parallelStream, removeIf, stream
public int size()
public boolean isEmpty()
public boolean contains(Object o)
public Object[] toArray()
public <T> T[] toArray(T[] a)
public boolean add(E s)
public boolean remove(Object o)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
public boolean addAll(Collection<? extends E> c)
public boolean retainAll(Collection<?> c)
public boolean removeAll(Collection<?> c)
public void clear()
Copyright © 2019. All rights reserved.