structorunionspecifier.java
来自「plugin for eclipse」· Java 代码 · 共 75 行
JAVA
75 行
/*
* Created on May 6, 2005
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package isis.anp.nesc.ot;
import isis.anp.common.ObjectTreeBuilderContext;
import java.util.ArrayList;
import java.util.List;
/**
* @author sallai
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public abstract class StructOrUnionSpecifier extends CompoundTypeSpecifier {
/**
* @param ctx
*/
public StructOrUnionSpecifier(ObjectTreeBuilderContext ctx) {
super(ctx);
}
ArrayList declarations;
ArrayList attributeList = new ArrayList();
/**
* @param sdlObj
*/
public void addDeclarations(List l) {
if(declarations == null) {
declarations = new ArrayList();
}
declarations.addAll(l);
}
public ArrayList getDeclarationList() {
return declarations;
}
public String toString() {
StringBuffer sb = new StringBuffer();
if(this instanceof StructSpecifier) {
sb.append("struct ");
} else if(this instanceof UnionSpecifier) {
sb.append("union ");
}
sb.append(getSpecifierName());
return sb.toString();
}
public boolean isComplete() {
return (declarations !=null);
}
public void addAttribute(Attribute attr) {
this.attributeList.add(attr);
}
/**
* @return Returns the attributeList.
*/
public ArrayList getAttributeList() {
return attributeList;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?