public final class UnmodifiableEntrySet<K,V> extends AbstractSetDecorator<java.util.Map.Entry<K,V>> implements Unmodifiable
Set
to ensure it can't be altered.
Attempts to modify it will result in an UnsupportedOperationException.
Modifier and Type | Class and Description |
---|---|
private class |
UnmodifiableEntrySet.UnmodifiableEntry
Implementation of a map entry that is unmodifiable.
|
private class |
UnmodifiableEntrySet.UnmodifiableEntrySetIterator
Implementation of an entry set iterator.
|
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
Serialization version
|
Modifier | Constructor and Description |
---|---|
private |
UnmodifiableEntrySet(java.util.Set<java.util.Map.Entry<K,V>> set)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.util.Map.Entry<K,V> object) |
boolean |
addAll(java.util.Collection<? extends java.util.Map.Entry<K,V>> coll) |
void |
clear() |
java.util.Iterator<java.util.Map.Entry<K,V>> |
iterator() |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> coll) |
boolean |
retainAll(java.util.Collection<?> coll) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
static <K,V> java.util.Set<java.util.Map.Entry<K,V>> |
unmodifiableEntrySet(java.util.Set<java.util.Map.Entry<K,V>> set)
Factory method to create an unmodifiable set of Map Entry objects.
|
decorated
contains, containsAll, equals, hashCode, isEmpty, setCollection, size, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID
public static <K,V> java.util.Set<java.util.Map.Entry<K,V>> unmodifiableEntrySet(java.util.Set<java.util.Map.Entry<K,V>> set)
K
- the key typeV
- the value typeset
- the set to decorate, must not be nulljava.lang.IllegalArgumentException
- if set is nullpublic void clear()
public boolean remove(java.lang.Object object)
public boolean removeAll(java.util.Collection<?> coll)
public boolean retainAll(java.util.Collection<?> coll)
public java.util.Iterator<java.util.Map.Entry<K,V>> iterator()
iterator
in interface java.lang.Iterable<java.util.Map.Entry<K,V>>
iterator
in interface java.util.Collection<java.util.Map.Entry<K,V>>
iterator
in interface java.util.Set<java.util.Map.Entry<K,V>>
iterator
in class AbstractCollectionDecorator<java.util.Map.Entry<K,V>>
public java.lang.Object[] toArray()