swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object wrappers and Lists in ObjectiveC and Java


From: Nick Collier
Subject: Re: Object wrappers and Lists in ObjectiveC and Java
Date: Fri, 30 Jun 2000 09:39:28 -0500

If you mean putting primitive "int"s into a Java collection, you do need
to create their Object equivalents. So,

Vector v = new Vector();
int i = 2;
v.add(new Integer(2));

and to get it out:

Integer anInt = (Integer)v.get(0);
int j = anInt.intValue();

Nick

Marie-Edith Bissey wrote:
> 
> Dear all,
> 
> As a learning exercise, I am writing the same simple program in Swarm
> using ObjectiveC and Java.
> - In ObjectiveC, I need to write a `wrapper' class in order to
> transform integers into objects before putting them into a swarm List
> - From what I seem to understand, in Java, I could just use the Java
> List class and forget all about object wrappers.
> 
> Is this right?
> 
> Thanking you in advance for your help,
> 
> Yours,
> 
> Marie-Edith.
> 
> __________________________________________________________________
> 
> Marie-Edith Bissey
> Universita` del Piemonte Orientale "Amedeo Avogadro"
> Facolta` di Science Politiche         email: address@hidden
> Corso Borsalino 50                    tel: +39-0131-283749
> 15 100 Alessandria -- ITALIA          fax: +39-0131-263030
> 
>                   ==================================
>    Swarm-Support is for discussion of the technical details of the day
>    to day usage of Swarm.  For list administration needs (esp.
>    [un]subscribing), please send a message to <address@hidden>
>    with "help" in the body of the message.

-- 
Nick Collier
Social Science Research Computing
University of Chicago
http://repast.sourceforge.net

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]