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

soot.jimple.infoflow.solver.gcSolver.GarbageCollectorPeerGroup Maven / Gradle / Ivy

There is a newer version: 2.9.0
Show newest version
package soot.jimple.infoflow.solver.gcSolver;

import java.util.Collection;
import java.util.HashSet;

import soot.SootMethod;

/**
 * Set of multiple garbage collectors that share a set of active dependencies
 * 
 * @author Steven Arzt
 *
 */
public class GarbageCollectorPeerGroup implements IGarbageCollectorPeer {

	private final Collection peers;

	public GarbageCollectorPeerGroup() {
		this.peers = new HashSet<>();
	}

	public GarbageCollectorPeerGroup(Collection peers) {
		this.peers = peers;
	}

	@Override
	public boolean hasActiveDependencies(SootMethod method) {
		for (IGarbageCollectorPeer peer : peers) {
			if (peer.hasActiveDependencies(method))
				return true;
		}
		return false;
	}

	/**
	 * Adds a garbage collector to this peer group
	 * 
	 * @param peer The garbage collector to add
	 */
	public void addGarbageCollector(IGarbageCollectorPeer peer) {
		this.peers.add(peer);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy