E - @Immutable public class ImmutableCollection<E> extends AbstractCollection<E> implements Immutable
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E e)
Deprecated.
throws
UnsupportedOperationException |
boolean |
addAll(Collection<? extends E> newElements)
Deprecated.
throws
UnsupportedOperationException |
void |
clear()
Deprecated.
throws
UnsupportedOperationException |
boolean |
contains(Object o) |
boolean |
equals(Object obj) |
int |
hashCode() |
ObjIterator<E> |
iterator() |
static <E> ImmutableCollection<E> |
of(Collection<? extends E> c) |
boolean |
remove(Object object)
Deprecated.
throws
UnsupportedOperationException |
boolean |
removeAll(Collection<?> oldElements)
Deprecated.
throws
UnsupportedOperationException |
boolean |
retainAll(Collection<?> elementsToKeep)
Deprecated.
throws
UnsupportedOperationException |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
containsAll, isEmptyparallelStream, removeIf, spliterator, streampublic static <E> ImmutableCollection<E> of(Collection<? extends E> c)
E - c - the elements in this Collection are shared by the returned ImmutableCollection.@Deprecated public final boolean add(E e) throws UnsupportedOperationException
UnsupportedOperationExceptionadd in interface Collection<E>add in class AbstractCollection<E>e - UnsupportedOperationException@Deprecated public final boolean addAll(Collection<? extends E> newElements) throws UnsupportedOperationException
UnsupportedOperationExceptionaddAll in interface Collection<E>addAll in class AbstractCollection<E>newElements - UnsupportedOperationException@Deprecated public final boolean remove(Object object) throws UnsupportedOperationException
UnsupportedOperationExceptionremove in interface Collection<E>remove in class AbstractCollection<E>object - UnsupportedOperationException@Deprecated public final boolean removeAll(Collection<?> oldElements) throws UnsupportedOperationException
UnsupportedOperationExceptionremoveAll in interface Collection<E>removeAll in class AbstractCollection<E>oldElements - UnsupportedOperationException@Deprecated public final boolean retainAll(Collection<?> elementsToKeep) throws UnsupportedOperationException
UnsupportedOperationExceptionretainAll in interface Collection<E>retainAll in class AbstractCollection<E>elementsToKeep - UnsupportedOperationException@Deprecated public final void clear() throws UnsupportedOperationException
UnsupportedOperationExceptionclear in interface Collection<E>clear in class AbstractCollection<E>UnsupportedOperationExceptionpublic boolean contains(Object o)
contains in interface Collection<E>contains in class AbstractCollection<E>o - public ObjIterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in class AbstractCollection<E>public int size()
size in interface Collection<E>size in class AbstractCollection<E>public Object[] toArray()
toArray in interface Collection<E>toArray in class AbstractCollection<E>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in class AbstractCollection<E>T - a - public boolean equals(Object obj)
equals in interface Collection<E>equals in class Objectobj - public int hashCode()
hashCode in interface Collection<E>hashCode in class Objectpublic String toString()
toString in class AbstractCollection<E>Copyright © 2021. All rights reserved.