token.java

来自「实验软装置(基于表达式的计算器ExprEval) 很不错的 有帮助于学习提高」· Java 代码 · 共 57 行

JAVA
57
字号
package scanner;

public class Token extends Symbol{

	/**
	 * value of token
	 */
	double value;
	/**
	 * priority of token
	 */
	int priority;
	/**
	 * type of token
	 */
	int type;
	
	/**
	 * constructor
	 * @param Name name of token
	 * @param Value value of token
	 * @param Type type of token
	 * @param Priority priority of token
	 */
	public Token(String Name,double Value,int Type,int Priority)
	{
		super(Name);
		value=Value;
		priority=Priority;
		type=Type;
	}
	
	/**
	 * get token type
	 * @return an int indicating type of token
	 */
	public int getType(){
		return type;
		
	}
	/**
	 * get the priority of token
	 * @return priority of token
	 */
	public int getPriority()
	{
		return priority;
	}
	/**
	 * get the value of token
	 * @return value of token
	 */
	public double getValue(){
		return value;
	}
}

⌨️ 快捷键说明

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