File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data Structure for logic tree

 
Michael Arnett
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
I am attempting to design a solution for filtering messages. Essentially, I am looking for a data structure that I can map into a database schema which will allow users to define their own filters such as:

if ( c1 AND c2 ) OR ( c3 AND c4 AND ( c5 OR c6 ) ) OR c7 then filter message
Any suggestions would be greatly appreciated. Are there any existing standards, libraries, or design patterns to tackle this task? Seems like it would be a common problem albeit a complex one.
Thanks in advance,
-MLA
 
Neil Laurance
Ranch Hand
Posts: 183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps use XML? Then you could use XSL to transform your structure to an SQL or other query to decide on the filtering:

Hope this helps
 
Neil Laurance
Ranch Hand
Posts: 183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And the XSL to transform this back to the original text:

 
Neil Laurance
Ranch Hand
Posts: 183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't you just love the way UBB formats your code sections :roll: :roll:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic