IntelliJ open source
[Logo] JavaRanch » Big Moose Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Products » Other Open Source Projects
 
RSS feed
 
New topic
Author

Boolean Expression Evaluation Framework

Priyanka Dandekar
Ranch Hand

Joined: Aug 06, 2008
Messages: 51

We are looking for an expression evaluation framework where we can provide input as boolean conditions like this

(MyData1 = 'A') AND (MyData2 = 'B' OR MyData2 = 'C' OR MyData2 = 'D')


I would be getting a String expression and would provide the data to that expression to find what will be the result.

Any suggestions of pointers would be appreciated.

Priya - Linux | Java | Struts2 | Lucene
Ulf Dittmer
Sheriff

Joined: Mar 22, 2005
Messages: 26792

I don't recall if it supports exactly this syntax, but check out the JEP library. Version 2.4 was released under the GPL, so you may be able to use it for free.

Java web chartsImageJ PluginsSpecification URLsJava FAQs
Sachin Joshi
Ranch Hand

Joined: Aug 06, 2008
Messages: 78

JEP is a good Java library, and its 2.4.1 version was GPL.

The Boolean expressions are supported but it does not give direct boolean result.

The results of a boolean expression would be returned to you as a Double object where 1.0 = TRUE and 0.0 is FALSE.


The Boolean Expression Evaluation Example code can be used as a Utility in your application for Boolean expression evaluation.
[ September 22, 2008: Message edited by: Sachin Joshi ]

Regards,
Sachin
Priyanka Dandekar
Ranch Hand

Joined: Aug 06, 2008
Messages: 51

Ulf and Sachin, thanks a lot for your responses. This is definitely useful for me.

Sachin I am using your util class for implementation, it looks handy.

Priya - Linux | Java | Struts2 | Lucene
mohan pusarla
Greenhorn

Joined: Jan 31, 2008
Messages: 2

Hi ,
If i can understand you correctly Your system always get the expression at the Run time and the values to be replaced in the expression also comes in run time. Recently i was also in search of looking for a similar framework approach. I found cayenne framework..you can use it very easily.Reply me back if you have any queries.
Ulf Dittmer
Sheriff

Joined: Mar 22, 2005
Messages: 26792

mohan,
can you provide a link to this "cayenne" framework? The only Java project with that name I can find is an ORM tool, and I don't think that would be applicable here.

Java web chartsImageJ PluginsSpecification URLsJava FAQs
Gupta Mohit Gupta
Greenhorn

Joined: Mar 21, 2010
Messages: 1

Check http://code.google.com/p/xpressionengine/. It may cater the requirements.
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Products » Other Open Source Projects
 
RSS feed
 
New topic
JProfiler
Get rid of your performance problems and memory leaks!

.