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

soot.jimple.infoflow.android.manifest.containers.EagerComponentContainer Maven / Gradle / Ivy

There is a newer version: 2.14.1
Show newest version
package soot.jimple.infoflow.android.manifest.containers;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import soot.jimple.infoflow.android.manifest.IAndroidComponent;
import soot.jimple.infoflow.android.manifest.IComponentContainer;

/**
 * Component container for eager loading
 * 
 * @author Steven Arzt
 *
 */
public class EagerComponentContainer implements IComponentContainer {

	private final Map innerCollection;

	public EagerComponentContainer(Collection innerCollection) {
		this.innerCollection = new HashMap<>(innerCollection.size());
		for (E e : innerCollection)
			this.innerCollection.put(e.getNameString(), e);
	}

	@Override
	public List asList() {
		return new ArrayList<>(innerCollection.values());
	}

	@Override
	public Iterator iterator() {
		return innerCollection.values().iterator();
	}

	@Override
	public E getComponentByName(String name) {
		return innerCollection.get(name);
	}

	@Override
	public boolean isEmpty() {
		return innerCollection.isEmpty();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy