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

org.aksw.commons.collections.FlatMapView Maven / Gradle / Ivy

package org.aksw.commons.collections;

import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Iterator;

/**
 * Created by Claus Stadler
 * Date: Oct 9, 2010
 * Time: 5:41:56 PM
 */
public class FlatMapView
        extends AbstractCollection
{
    private Collection> internal;

    public FlatMapView(Collection> internal) {
        this.internal = internal;
    }


    @Override
    public Iterator iterator() {
        return new ChainIterator(internal.iterator());
    }

    @Override
    public int size() {
        int result = 0;
        for(Collection item : internal) {
            result += item.size();
        }

        return result;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy