Re: A newbie question related to using bsh

KUN LI <[email protected]> Wed, 5 Aug 2009 17:34:43 +0200
Newsgroups gmane.comp.java.beanshell.user
Message-ID <[email protected]>
You can use "Collection" which can be a "List" or "Vector".

Example:

Collection<A> results =3D new Arraylist();

results.add(result);

Kun LI




> Date: Wed, 5 Aug 2009 15:22:02 +0000
> From: javadeveloper999-/[email protected]
> To: Beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> Subject: [Beanshell-users] A newbie question related to using bsh
> =

> =

> I read the doc at http://www.beanshell.org/examples/callscript.html. But =
this arises me a question. How can I cast the result object into the type I=
 want? For instance, in the script I finally have type A created, then in t=
he Java application I obtained using the following statement
> =

> Object result =3D new bsh.Interpreter().source("myscript.bsh");
> =

> I can cast result to A if I only have one script e.g.
> =

> A a =3D (A) result;
> =

> However, how if I want to collect many scripts once and then cast all obj=
ect collected into type desired?
> =

> Is there any way I can achieve this?
> =

> Thanks for help.
> =

> =

> =

> =

>       =

> =

> -------------------------------------------------------------------------=
-----
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-D=
ay =

> trial. Simplify your report design, integration and deployment - and focu=
s on =

> what you do best, core application coding. Discover what's new with =

> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Beanshell-users mailing list
> Beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/beanshell-users

_________________________________________________________________
T=E9l=E9phonez gratuitement =E0 tous vos proches avec Windows Live Messenge=
r=A0 !=A0 T=E9l=E9chargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp
---------------------------------------------------------------------------=
---
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day =

trial. Simplify your report design, integration and deployment - and focus =
on =

what you do best, core application coding. Discover what's new with =

Crystal Reports now.  http://p.sf.net/sfu/bobj-july