📄 actionset.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 + -