是zuojie用java实现的gep库

源代码在线查看: and.java

软件大小: 286 K
上传用户: myhpgnl
关键词: zuojie java gep
下载地址: 免注册下载 普通下载 VIP

相关代码

				package gep.bool;								import gep.Expression;								import java.util.ArrayList;				import java.util.List;								/**				 * 与表达式				 */				public class And implements BExpression				{					public static final char code = '&';					public static final int arity = 2;									private BExpression left;					private BExpression right;										public char getCode()					{						return code;					}									public int getArity()					{						return arity;					}									public void addChild(Expression child)					{						if (left==null)						{							left = (BExpression) child;							return; 						}												if (right==null)						{							right = (BExpression) child;							return;						}												throw new IllegalStateException("ADD_CHILD_ERROR");					}									public boolean evaluate()					{						return left.evaluate() && right.evaluate();					}									public String toString()					{						//return "(" + left + "&" + right + ")";						return left + "&" + right;					}									public List getChildren()					{						List children = new ArrayList();						children.add(left);						children.add(right);												return children;					}				}							

相关资源