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

📄 topicutility.java

📁 java实现的P2P多agent中间件
💻 JAVA
字号:
package jade.core.messaging;

import jade.core.AID;

/**
 * This class embeds topic related utility methods that must be available in MIDP
 */
public class TopicUtility {
	public static final AID createTopic(String topicName) {
		return new AID(topicName+'@'+TopicManagementHelper.TOPIC_SUFFIX, AID.ISGUID);
	}
	
	public static final boolean isTopic(AID id) {
		// NOTE that checking the endsWith() condition is much faster as it does not involve extracting
		// the HAP from the AID --> Whenever an AID is not a topic we immediately detect that
		if (id.getName().endsWith(TopicManagementHelper.TOPIC_SUFFIX)) {
			return TopicManagementHelper.TOPIC_SUFFIX.equals(id.getHap());
		}
		else {
			return false;
		}
	}
}

⌨️ 快捷键说明

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