StringToBool is a java library with the sole purpose of calculating boolean operation written as String.
StringToBool (from now on abbreviated as STB) has been created with the purpose to help programmers calculate boolean operation by simply inputting a string to receive
the result as a boolean.
As STB is an Object, to be used it must be created: (Object name will be subject to change) sequenceBool a = new sequenceBool("")
, to get the result value, use the
method "scomponi". Example: a.scomponi("(x < y) & (3 le 5)")
.
STB as of now supports the main boolean operations:
- "A or B": to use this operation the simbol "|" must be written as follows: "(generic formula A) | (generic formula B)", it will return true if one of the two formula is true, false otherwise;
- "A and B": to use this operation the simbol "&" must be written as follows: "(generic formula A) & (generic formula B)", it will return true if both the two formula are true, false otherwise.
STB as of now supports different comparation:
- "x == y": x equals y, this operation must be implemented inside parentesis as follows: "(x == y)", it will return true if the value x equals to the value y;
- "x < y" : x less then y, this operation must be implemented inside parentesis as follows: "(x < y)", it will return true if the value x is less then y;
- "x > y" : x Greater then y, this operation must be implemented inside parentesis as follows: "(x > y)", it will return true if the value x is greater then y;
- "x le y" : x less equal then y, this operation must be implemented inside parentesis as follows: "(x le y)", it will return true if the value x is less or equal to y;
- "x ge y" : x Greater equal then y, this operation must be implemented inside parentesis as follows: "(x ge y)", it will return true if the value x is greater or equal to y;
°STB is a project under development and will be subject to changes. For any information regarding STB e-mail me at: [email protected]