HashMap in JEP

24 views
Skip to first unread message

anshu gupta

unread,
Sep 17, 2011, 5:08:34 AM9/17/11
to Jep Java Users
Dear Sir,Mam
I am using JEP API to calculate the amount from the formula .

e.g:- 0.51(PayBand+GradePay)

All the operands and their respective values are stored in hasmap.So
please tell me how to add this name and value in jep.addVariable()
method so that i can evaluate this expression
Please reply asap.

Thanks & Regards
Anshul

Richard Morris

unread,
Sep 20, 2011, 10:56:56 AM9/20/11
to jep-...@googlegroups.com
Dear Anshul,

In general you will want to use

jep.addVariable("GradePay",20000);

to update the JEP variable. You can call this multiple times if you
need to run the formula with different values.

If you data is in a HashMap the you could use

jep.addVariable("GradePay", MyMap.get("GradePay"));

Richard

> --
> You received this message because you are subscribed to the Google Groups "Jep Java Users" group.
> To post to this group, send email to jep-...@googlegroups.com.
> To unsubscribe from this group, send email to jep-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jep-users?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages