public class PolishExpr extends Object
| 构造器和说明 |
|---|
PolishExpr() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
isLeftParenthesis(Op token) |
static boolean |
isOperand(Op token) |
static boolean |
isOperator(Op token) |
static boolean |
isRightParenthesis(Op token) |
static List<Op> |
reversePolish(List<Op> tokens)
将中缀表达式转换成逆波兰表达式
Shunting-yard algorithm http://en.wikipedia.org/wiki/Shunting_yard_algorithm |
static List<Op> |
reversePolish(String expression)
将中缀表达式转换成逆波兰表达式
|
public static List<Op> reversePolish(String expression)
expression - public static List<Op> reversePolish(List<Op> tokens)
tokens - public static boolean isOperand(Op token)
public static boolean isLeftParenthesis(Op token)
public static boolean isRightParenthesis(Op token)
public static boolean isOperator(Op token)
Copyright © 2012–2016. All rights reserved.