2条回答 默认 最新
- 普通网友 2016-10-04 18:38关注
语句解析方法:
已知一个单条件判断方式:boolean compareItem(String fieldName, String operation, String operValue);
实现一个SQL解析函数,要求:
支持and、or;
支持括号;
支持引号;
字段名使用前缀$标识。
输入语句如:($size >= 500 and ($type != "类 型 12 3" or 0 <= $checked)) 其中 size type checked为字段名
public class ParseCondition {
public static void main(String[] args) throws ParseException {
System.out.println(parse("($size >= 500 and ($type != \"类 型 12 3\" or 0 <= $checked))"));
}
public static boolean parse(String conditionStr) {
//请编写} private static boolean compareItem(String fieldName, String operation, String operValue) { System.out.println(fieldName
解决 无用评论 打赏 举报
悬赏问题
- ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
- ¥20 有关区间dp的问题求解
- ¥15 多电路系统共用电源的串扰问题
- ¥15 slam rangenet++配置
- ¥15 有没有研究水声通信方面的帮我改俩matlab代码
- ¥15 对于相关问题的求解与代码
- ¥15 ubuntu子系统密码忘记
- ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
- ¥15 保护模式-系统加载-段寄存器
- ¥15 电脑桌面设定一个区域禁止鼠标操作