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

📄 oldroutingtable.java

📁 发布/订阅系统路由重配算法,可应用于ad hoc环境
💻 JAVA
字号:
///*// * Created on May 4, 2005// *// * To change the template for this generated file go to// * Window>Preferences>Java>Code Generation>Code and Comments// *///package broker;////import java.util.*;/////**// * @author parzy// *// * To change the template for this generated type comment go to// * Window>Preferences>Java>Code Generation>Code and Comments// *///public class OldRoutingTable {//	//	protected static class Entry{//		final Filter filter;//		final Broker broker;//		private boolean done = false;//		//		Entry(Filter filter, Broker broker){//			this.filter = filter;//			this.broker = broker;//		}//		//		boolean isDone(){//			return done;//		}//		//		void markAsDone(){//			done = true;//		}//		//		void markAsUndone(){//			done = false;//		}//	}//	//	protected Broker local;//	protected LinkedList table;//	//	public OldRoutingTable(Broker local){//		this.local = local;//		this.table = new LinkedList();		//	}//	//	public OldDestinationSet subscribe(Broker from, Subscription s){//		Filter f;//		OldDestinationSet destinations;//		Entry e;//		//		// not really necessary//		if(!local.equals(from)){//			throw new IllegalArgumentException();//		}//		//		f = s.getFilter();//		destinations = new OldDestinationSet(local, from, s);//		//		// for each entry ensure idempotent operation//		for(Iterator it = table.iterator(); it.hasNext(); ){//			e = (Entry)it.next();//			// since flooding: from == local == e.broker //			if(f.equals(e.filter)){//				return destinations;//			}//		}//		table.add(new Entry(f,from));//		return destinations;//	}////	public OldDestinationSet unsubscribe(Broker from, Unsubscription u){//		Filter f;//		OldDestinationSet destinations;//		Entry e;//		//		// not really necessary//		if(!local.equals(from)){//			throw new IllegalArgumentException();//		}//		//		f=u.getFilter();//		destinations = new OldDestinationSet(local, from, u);//		// ensure idempotent operation//		for(Iterator it = table.iterator(); it.hasNext(); ){//			e = (Entry)it.next();//			if(f.equals(e.filter)){//				it.remove();//				return destinations;//			}//		}//		return destinations;//	}//	//	public OldDestinationSet forward(Broker from, Notification n){//		OldDestinationSet destinations;//		Entry e;//		//		destinations = new OldDestinationSet(local,from,n);//		//		for(Iterator it = table.iterator(); it.hasNext(); ){//			e = (Entry)it.next();////			if(e.filter.match(n)){//				destinations.includeLocal();//				break;//			}//		}		//		return destinations;//	}//}

⌨️ 快捷键说明

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