All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.javagimmicks.collections.composite.CompositeCollection Maven / Gradle / Ivy

There is a newer version: 0.99-alpha1
Show newest version
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> _collections;

   CompositeCollection(List> 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