/* * Proxy.java * * Created on 11. November 2005, 14:00 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.semports.handshakes; import java.util.HashSet; import java.util.Iterator; /** * This class represents the PSI sets of one Proxy. * * @author Lutz Maicher **/ public class Proxy { String id; HashSet repository; HashSet repository_new; HashSet proxyRepository; HashSet proxyRepository_new; public HashSet getRepository() { return repository; } /** This function tests whether this Proxy is equal to an other Proxy. * Equality is decided according the TMDM: if both have a pair of * equal PSIs in their repository equality holds. */ public boolean equal(Proxy req) { /* HashSet test = new HashSet(repository); test.retainAll(req.getRepository()); return !test.isEmpty(); */ /** Für große Mengen ist es billiger durch die * kleinere von beiden Mengen zu iterieren und * zu schauen, ob ein Element in der größeren * Menge vorkommt. **/ Iterator it; HashSet check; boolean equal = false; if (req.repository.size()