How to store multiple requirements with OR and AND?

Posted by Cano on Programmers See other posts from Programmers or by Cano
Published on 2012-06-16T00:57:55Z Indexed on 2012/06/16 3:23 UTC
Read the original article Hit count: 192

Filed under:
|

Well I'm working on a personal project that needs to check if a user has met certain requirements, and they come in a form of

Requirement: [c1 OR c2] AND [d1 OR d2]

Requirement: [c1 AND c2] OR [d1 AND d2]

Requirement: c1 AND any dn(n can be any integer)

I'm just not sure how to store these sorts of requirements, I'm thinking of using another object to hold c1,c2,d1,d2....dn and OR, but that seems like a roundabout way of doing things. Is there a better method?

© Programmers or respective owner

Related posts about java

Related posts about object-oriented