edu.mit.jmwe.util
Class CompositeCollection<E>
java.lang.Object
java.util.AbstractCollection<E>
edu.mit.jmwe.util.CompositeCollection<E>
- Type Parameters:
E
- the element type in the collection
- All Implemented Interfaces:
- Iterable<E>, Collection<E>
- Direct Known Subclasses:
- MWEDescSet
public class CompositeCollection<E>
- extends AbstractCollection<E>
A collection that is composed of several subsets of elements.
- Since:
- jMWE 1.0.0
- Version:
- $Id: CompositeCollection.java 555 2011-05-05 19:20:59Z markaf $
- Author:
- M.A. Finlayson
Methods inherited from class java.util.AbstractCollection |
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
subsets
protected final List<Collection<? extends E>> subsets
CompositeCollection
public CompositeCollection(Collection<? extends E>... subsets)
- Constructs this composite collection from the given array of subsets.
- Parameters:
subsets
- the collections containing the elements in this composite
collection.
- Throws:
NullPointerException
- if any of the subsets are null
.
IllegalArgumentException
- if all of the subsets are empty.- Since:
- jMWE 1.0.0
CompositeCollection
public CompositeCollection(Iterable<Collection<? extends E>> subsets)
- Constructs this composite collection from the given collection of subsets.
- Parameters:
subsets
- the collections containing the elements in this composite
collection.
- Throws:
NullPointerException
- if any of the subsets are null
.
IllegalArgumentException
- if all of the subsets are empty.- Since:
- jMWE 1.0.0
size
public int size()
- Specified by:
size
in interface Collection<E>
- Specified by:
size
in class AbstractCollection<E>
iterator
public Iterator<E> iterator()
- Specified by:
iterator
in interface Iterable<E>
- Specified by:
iterator
in interface Collection<E>
- Specified by:
iterator
in class AbstractCollection<E>
Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.