📄 abstracterrorinforinexpr.java
字号:
/* * Copyright (C) 2003-2008 Wang Pengcheng <wpc0000@gmail.com> * Permission is granted to copy, distribute and/or modify this * document under the terms of the GNU Free Documentation License, * Version 2.0 or any later version published by the Free Software Foundation; * with no Invariant Sections. * You may obtain a copy of the License at * http://www.gnu.org/licenses/lgpl.txt *///1 Mar 2008package cn.edu.whu.iss.algorithm.unit10.expression.structure;public abstract class AbstractErrorInforInExpr implements ErrorInforInExpression { public static final int LEFT_BRACKET_ERROR = 0; public static final int RIGHT_BRACKET_ERROR = 1; public static final int OPERATOR_USE_ERROR = 2; public static final String LEFT_BRACKET_MESSAGE = "Syntax error, insert \")\" to complete Expression"; public static final String RIGHT_BRACKET_MESSAGE = "Syntax error, insert \"(\" to complete Expression"; public static final String OPERATOR_USE_MESSAGE = "Syntax error, check the expression operator in the left"; public static final String[] ERROR_MESSAGE = { LEFT_BRACKET_MESSAGE,RIGHT_BRACKET_MESSAGE,OPERATOR_USE_MESSAGE }; public static final String getErrorMessage(int id){ if(id<0||id>=ERROR_MESSAGE.length){ return null; }; return ERROR_MESSAGE[id]; } protected int index; protected int errorId; public AbstractErrorInforInExpr(int index, int errorId) { super(); this.index = index; this.errorId = errorId; } public AbstractErrorInforInExpr() { super(); } public int compareTo(ErrorInforInExpression o) { return this.index-o.getErrorLocation(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -