⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oldcoveringdestinationset.java

📁 发布/订阅系统路由重配算法,可应用于ad hoc环境
💻 JAVA
字号:
/*// * project: RebecaSim// * package: broker// * file:    CoveringDestinationSet.java// * // * version: 0.1// * date:    06.05.2005// * // * This software is part of the diploma thesis "Ein adaptives Brokernetz // * für Publish/Subscribe Systeme".// *///package broker;////import java.util.*;/////**// * TODO Insert class description here.// *// * @version 06.05.2005// * @author  parzy// *///public class OldCoveringDestinationSet extends OldDestinationSet {////	protected boolean restricted = false;//	protected Broker src = null;//	protected static final int FILTER = 4;//	//	/**//	 * @param local//	 * @param from//	 * @param s//	 *///	public OldCoveringDestinationSet(Broker local, Broker from, Subscription s) {//		super(local, from, s);//		// TODO Auto-generated constructor stub//		Broker neighbor;//		for(Iterator it = local.getNeighbors().iterator(); it.hasNext(); ){//			neighbor = (Broker)it.next();//			if(!neighbor.equals(from)){//				destinations.put(neighbor, message);//			}//		}//	}////	/**//	 * @param local//	 * @param from//	 * @param u//	 *///	public OldCoveringDestinationSet(Broker local, Broker from, Unsubscription u) {//		super(local,from,new CoveringUnsubscription(u.getFilter(),new LinkedList()));//		// TODO Auto-generated constructor stub//		Broker neighbor;//		for(Iterator it = local.getNeighbors().iterator(); it.hasNext(); ){//			neighbor = (Broker)it.next();//			if(!neighbor.equals(from)){//				destinations.put(neighbor, message);//			}//		}//	}////	public OldCoveringDestinationSet(Broker local, Broker from, Broker src, Filter f){//		super();//		this.local = local;//		this.from = from;//		this.src = src;//		this.message = f;//		this.type = FILTER;//		//		Broker neighbor;//		for(Iterator it = local.getNeighbors().iterator(); it.hasNext(); ){//			neighbor = (Broker)it.next();//			if((!neighbor.equals(from)) && (!neighbor.equals(src))){//				destinations.put(neighbor, message);//			}//		}//	}//	//	/**//	 * @param local//	 * @param from//	 * @param n//	 *///	public OldCoveringDestinationSet(Broker local, Broker from, Notification n) {//		super(local, from, n);//		// TODO Auto-generated constructor stub//	}////	// okay, nun ein paar vernünftige Methodennamen//	public void add(Broker b){//		if(type != NOTIFICATION){//			throw new IllegalStateException();//		}//		//		// Do not send any notification back to receiver, but eventually//		// to another local client.//		if( (!b.equals(from)) || (b.equals(local)) ){//			destinations.put(b,message);//		}//	}////	public void restrictTo(Broker b){//		if( (type!=SUBSCRIPTION) && (type!=UNSUBSCRIPTION) && (type!=FILTER) ){//			throw new IllegalStateException();//		}//		//		if(fixed){//			return;//		}//		//		if(b.equals(src)){//			throw new IllegalStateException();//		}//		//		//		if(b.equals(local) || b.equals(from)){//			destinations.clear();//			fixed = true;//			return;//		}//	//		if(!restricted){//			destinations.clear();//			destinations.put(b,message);//			restricted = true;//		}else{	//			if(!destinations.containsKey(b)){//				destinations.clear();//				fixed = true;//			}//		}//	}////	public void includeSrc(){//		if(type != FILTER){//			throw new IllegalStateException();//		}//		//		if(fixed){//			return;//		}//		//		if(src != null){//			if(!restricted){//				destinations.put(src,message);//			}//			src = null;//		}//	}//	//	public void clear(){//		//		if(fixed){//			return;//		}//		//		destinations.clear();//		fixed = true;//	}//	//	public void addUncoveredFilters(OldCoveringDestinationSet uncoveredFilters){//		Entry e;//		CoveringUnsubscription u;//		if(type != UNSUBSCRIPTION){//			throw new IllegalStateException();//		}//		//		for(Iterator it = uncoveredFilters.iterator(); it.hasNext(); ){//			e = (Entry)it.next();//			u = (CoveringUnsubscription)destinations.get(e.getBroker());//			if(u == null){//				throw new IllegalStateException();//			}//			u.getUncoveredFilters().add(e.getMessage());//		}//	}//}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -