net.sf.javagimmicks.collections.composite.CompositeCollection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gimmicks Show documentation
Show all versions of gimmicks Show documentation
Utility classes, APIs and tools for Java
package net.sf.javagimmicks.collections.composite;
import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
class CompositeCollection extends AbstractCollection
{
protected final List extends Collection> _collections;
CompositeCollection(List extends Collection> collections)
{
_collections = collections;
}
@Override
public Iterator iterator()
{
return CompositeIterator.fromCollectionList(_collections);
}
@Override
public int size()
{
int result = 0;
for(Collection c : _collections)
{
result += c.size();
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy