⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rowjep.java

📁 mysql集群
💻 JAVA
字号:
/*****************************************************************************      SQLJEP - Java SQL Expression Parser 0.2      November 1 2006         (c) Copyright 2006, Alexey Gaidukov      SQLJEP Author: Alexey Gaidukov      SQLJEP is based on JEP 2.24 (http://www.singularsys.com/jep/)           (c) Copyright 2002, Nathan Funk       See LICENSE.txt for license information.*****************************************************************************/package com.meidusa.amoeba.sqljep;/** * Example of usage * <blockquote><pre> * 	Comparable[] row = {1,100.00,new java.util.Date()}; * 	HashMap<String,Integer> columnMapping = new HashMap<String,Integer>(); * 	columnMapping.put("ID",0); * 	columnMapping.put("SUM",1); * 	columnMapping.put("SALE_DATE",2); * 	RowJEP sqljep = new RowJEP("ID in (1,2,3) and SUM>100 and SALE_DATE>to_date('2006-01-01','yyyy-mm-dd')"); * 	try { * 		sqljep.parseExpression(columnMapping); * 		System.out.println(sqljep.getValue(row)); * 	} * 	catch (ParseException e) { * 		e.printStackTrace(); * 	} * </blockquote></pre> * @author Alexey Gaidukov * @see com.meidusa.amoeba.sqljep.BaseJEP */public class RowJEP extends BaseJEP {	public RowJEP(String exp) {		super(exp);	}	public void clear() {		super.clear();	}		public Comparable getColumnObject(int column) throws ParseException {		JepRuntime runtime = getThreadJepRuntime(this);		if(runtime.row != null){			try {				return runtime.row[column];			} catch (Exception e) {				throw new ParseException("Column index:"+column, e);			}		}else{			throw new ParseException("Column index:"+column);		}	}}

⌨️ 快捷键说明

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