This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes An open qustion. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "An open qustion." Watch "An open qustion." New topic
Author

An open qustion.

Praveen Kumar Singh
Ranch Hand

Joined: Mar 04, 2009
Posts: 43
Hi All,

In my project I have requirement to solve equation like this

(oid:10) and (lid:4 or lid:3) and ( (cid:91 or cid:92) OR (oid:13 and did:50))

And need to expend it like

oid:10 and lid:4 or oid:10 and lid:3 and cid:91 or oid:10 and lid:4 or oid:10 and lid:3 and cid:92 or oid:10 and lid:4 or oid:10 and lid:3 and oid:13 and .............

Does anybody have idea or algorithm to solve this kind of problem ?
Pleases share even if you have some partial idea.

Praveen
SCJP, SCWCD, SOA
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Please UseAMeaningfulSubjectLine instead of something general like "An open question".

From your example it is not clear exactly what you want to do. In Boolean logic there are some equivalences, for example "A AND (B OR C)" can be written as "(A AND B) OR (A AND C)", etc. If this kind of transformation is what you want to do, then study the rules of Boolean logic.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Praveen Kumar Singh
Ranch Hand

Joined: Mar 04, 2009
Posts: 43
You got my requirement Jesper,
I want to expend my equation but problematically.
Only problem is i am not able to write logic for that.
I am considering expression tree right now but so far no success !
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: An open qustion.
 
Similar Threads
Passed with a 91% last friday
Part 1: 91%
Passed SCWCD - 91%
Passed with a 91% last friday
91%