functiontype.java

来自「plugin for eclipse」· Java 代码 · 共 71 行

JAVA
71
字号
/*
 * Created on May 9, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package isis.anp.nesc.ot.types;

import isis.anp.nesc.ot.Outline;
import isis.anp.nesc.ot.ParameterTypeList;


/**
 * @author sallai
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class FunctionType  extends ConstructedType {
	ParameterTypeList parameterTypeList;
	
	public FunctionType(Type returnType, ParameterTypeList ptl) {
		super(returnType);
		this.parameterTypeList = ptl;
	}
	
	public void outline(Outline o) {
		if(getEnclosedType()!=null) {
			getEnclosedType().outline(o);
		} else {
			o.append("<unknown>");
		}
		o.ensureSpace();
		o.append("(");
		o.ensureSpace();
		o.append(getTypeQualifierString());
		o.append(")");
		o.ensureSpace();
		o.append("(");
		o.ensureSpace();

		parameterTypeList.outline(o);
		
		o.ensureSpace();
		o.append(")");		
	}
	
	/**
	 * @return Returns the parameterTypeList.
	 */
	public ParameterTypeList getParameterTypeList() {
		return parameterTypeList;
	}
	/**
	 * @param parameterTypeList The parameterTypeList to set.
	 */
	public void setParameterTypeList(ParameterTypeList parameterTypeList) {
		this.parameterTypeList = parameterTypeList;
	}

    /* (non-Javadoc)
     * @see parser.nesc.ot.types.Type#clone()
     */
    public Object clone() {
        FunctionType rval = new FunctionType(this.enclosedType, this.parameterTypeList);
        rval.typeQualifiers = this.typeQualifiers;
        
        return rval;
    }
}

⌨️ 快捷键说明

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