软件设计模式复习题(14)

2020-11-29 00:35

int i = stk.Count -2; if (i >= 0) return (ParseObject)stk[i]; else return null;} public void pop2Push(ParseObject p){ int i = stk.Count ; if (i >= 2) { pop(); pop(); push(p);} else push(p);}}} ParseObject解析对象类: public class ParseObject{ public const int VERB=1000; public const int VAR=1010; public const int MULTVAR=1020; protected int value, type; public ParseObject(int val, int typ) { value = val; type = typ; } public int getValue() { return value;} public int getType() { return type;}} Parser解析类: public class Parser{

public Parser(string line, StudentData kd, ListBox pt) { stk = new Stack (); actionList = new ArrayList (); setData(kd, pt); buildStack(line); buildChain();}

public void setData(StudentData kd, ListBox pt) { dat = new Data(kd.getData ()); ptable = pt;} public void Execute() { while(stk.hasMoreElements () ) { chn.sendToChain (stk);} for(int i=0; i< actionList.Count ; i++ ) { Verb v = (Verb)actionList[i]; v.setData (dat, ptable); v.Execute ();}}}


软件设计模式复习题(14).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:二年级100以内加减乘除混合口算题(100题1页)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: