|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.kernel.util.UnmodifiableCollection<E>
E
- the element type.public class UnmodifiableCollection<E>
This class is used to create an unmodifiable view of collections. It
is intended to mimic the behavior of
java.util.Collections.unmodifiableCollection(java.util.Collection)
,
but in a more explicit way. If a method returns an
UnmodifiableCollection
, it's clear that the collection is
unmodifiable and that UnsupportedOperationException
will be thrown
if modification is attempted.
Constructor Summary | |
---|---|
UnmodifiableCollection(java.util.Collection<E> c)
Constructs a new unmodifiable view of the provided collection. |
Method Summary | ||
---|---|---|
boolean |
add(E o)
See Collection.add(Object). |
|
boolean |
addAll(java.util.Collection<? extends E> c)
See Collection.addAll(Collection). |
|
void |
clear()
See Collection.clear(). |
|
boolean |
contains(java.lang.Object o)
See Collection.contains(Object). |
|
boolean |
containsAll(java.util.Collection<?> c)
See Collection.containsAll(Collection). |
|
boolean |
equals(java.lang.Object obj)
See Collection.equals(Object). |
|
int |
hashCode()
See Collection.hashCode(). |
|
boolean |
isEmpty()
See Collection.isEmpty(). |
|
java.util.Iterator<E> |
iterator()
See Collection.iterator(). |
|
boolean |
remove(java.lang.Object o)
See Collection.remove(Object). |
|
boolean |
removeAll(java.util.Collection<?> c)
See Collection.removeAll(Collection). |
|
boolean |
retainAll(java.util.Collection<?> c)
See Collection.retainAll(Collection). |
|
int |
size()
See Collection.size(). |
|
java.lang.Object[] |
toArray()
See Collection.toArray(). |
|
|
toArray(T[] a)
See Collection.toArray(Object[]). |
|
java.lang.String |
toString()
Returns toString() on the underlying collection. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UnmodifiableCollection(java.util.Collection<E> c)
c
- the collection for which an unmodifiable view is created.Method Detail |
---|
public boolean add(E o)
add
in interface java.util.Collection<E>
public boolean addAll(java.util.Collection<? extends E> c)
addAll
in interface java.util.Collection<E>
public void clear()
clear
in interface java.util.Collection<E>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<E>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<E>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<E>
public java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<E>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<E>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<E>
public int size()
size
in interface java.util.Collection<E>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<E>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<E>
public java.lang.String toString()
toString()
on the underlying collection.
toString
in class java.lang.Object
toString()
on the underlying collection.public boolean equals(java.lang.Object obj)
equals
in interface java.util.Collection<E>
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Collection<E>
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |