commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Дмитрий Белавенцев <dizp...@gmail.com>
Subject [JEXL] Override bitwise xor
Date Wed, 30 Nov 2011 17:36:58 GMT
Hi!
I want to process "^" in JEXL like Math.pow(), but not as XOR. How can I do
it?

I tried to extend:

1. Interpreter class http://pastebin.com/TpDKKbAY
2. JexlEngine class http://pastebin.com/kaiuuLRQ

It works on expression like this:

x^2
(x^2)
(x^2)+(y^3)

but it doesn't work on the following examples:

x^3+y^2
x^2+y^3+z^4

etc

So and in extended JexlEngine class I receive a warning message from
Eclipse about setRegisters() method of extended Interpreter class (cause of
"protected" modifier).

So, I have the following question. Does  some good way to override bitwise
xor operation in JEXL by Math.pow()  is exist? I can't believe  that it's
false - this lib should be flexible enough, isn't it?

TIA!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message