org.eclipse.osgi.internal.serviceregistry
Class ShrinkableCollection<E>

java.lang.Object
  extended by org.eclipse.osgi.internal.serviceregistry.ShrinkableCollection<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>

public class ShrinkableCollection<E>
extends Object
implements Collection<E>

A Shrinkable Collection. This class provides a wrapper for a list of collections that allows items to be removed from the wrapped collections (shrinking) but does not allow items to be added to the wrapped collections.

The collections must act as sets in that each collection in the list must not have two entries which are equal.

All the optional Collection operations except add and addAll are supported. Attempting to add to the collection will result in an UnsupportedOperationException.


Constructor Summary
ShrinkableCollection(Collection<? extends E> c)
           
ShrinkableCollection(Collection<? extends E> c1, Collection<? extends E> c2)
           
ShrinkableCollection(List<Collection<? extends E>> l)
           
 
Method Summary
 boolean add(E e)
           
 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[] var0)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

ShrinkableCollection

public ShrinkableCollection(Collection<? extends E> c)

ShrinkableCollection

public ShrinkableCollection(Collection<? extends E> c1,
                            Collection<? extends E> c2)

ShrinkableCollection

public ShrinkableCollection(List<Collection<? extends E>> l)
Method Detail

add

public boolean add(E e)
Specified by:
add in interface Collection<E>

addAll

public boolean addAll(Collection<? extends E> c)
Specified by:
addAll in interface Collection<E>

clear

public void clear()
Specified by:
clear in interface Collection<E>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<E>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<E>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<E>

iterator

public Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<E>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<E>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<E>

size

public int size()
Specified by:
size in interface Collection<E>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<E>

toArray

public <T> T[] toArray(T[] var0)
Specified by:
toArray in interface Collection<E>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.