On 10/12/01 11:27 PM, "Terry Steichen" <[EMAIL PROTECTED]> wrote:

> Geir,
> 
> I think I'm on the track of a solution this problem.  I tried the following:
> 
>   $entry.elementAt(0).Price.intValue()
> 
> and it seems to be working somewhat (though I'm far from confident that I know
> exactly why).  I'm far too tired to do any more this pm, so will get back at
> it in the am.  Thanks for all your help.

The reason why is that while you have

public float getPrice()

The reflection API will wrap primitive types in the corresponding object
(float->Float) when the method is successfully invoked.

Hence, you can intValue()

Note that references cannot be primitive types - you can't stuff one in the
context ( put() takes an object) and as I said above, the reflection API
returns any primitive return values wrapped.

Geir



> 
> Regards,
> 
> Terry
> 
> PS: To Bojan - Yes, I did try to context.put("int", new Integer(0)) and that
> works, but my varb is a float.
> 

-- 
Geir Magnusson Jr.     [EMAIL PROTECTED]
System and Software Consulting
"Whoever would overthrow the liberty of a nation must begin by subduing the
freeness of speech." - Benjamin Franklin


Reply via email to