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

📄 actionset.java

📁 PEPA模型性能分析工具
💻 JAVA
字号:
package semantic;

public class ActionSet {
	Action elem;
	ActionSet next;
	
	public ActionSet(Action e,ActionSet n)
	{
		elem=e;
		next=n;
	}
	public ActionSet()
	{
		elem=null;
		next=null;
	}
	public boolean isEmpty()
	{
		if(elem==null) return true;
		else return false;
	}
	public ActionSet(Action e)
	{
		elem=e;
		next=null;
	}
	public ActionSet put(Action e)
	{
		if(elem==null)
		{
			elem=e;
			return this;
		}else
		{
	/*		ActionSet pos=this;
			while(pos.next!=null)
				pos=pos.next;
	*/		if(!e.equals(elem))
			{	
				ActionSet pos=new ActionSet(e);
				pos.next=this;
				return pos;
			}
		}
		return this;
	}
	public boolean contain(Action a)
	{
		ActionSet s=this;
		if(elem==null)
			return false;
		while(s!=null)
		{
			if(a.equals(s.elem))
				return true;
			s=s.next;
		}
		return false;
	}
	public String toString()
	{
		if(elem==null)
			return null;
		String s=elem.toString();
		ActionSet pos=this.next;
		while(pos!=null)
		{
			s+=",";
			s+=pos.elem.toString();
			pos=pos.next;
		}
		return s;
	}
}

⌨️ 快捷键说明

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