swarm-support
[Top][All Lists]
Advanced

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

Re: swarm lib


From: Marcus G. Daniels
Subject: Re: swarm lib
Date: Wed, 29 May 2002 09:18:19 -0600 (MDT)

Cindy> I have been working on my own simple swarm progams.  I am confused in
Cindy> using some swarm lib(Java). I wrote a simple program below (it works
Cindy> if I use only Java lib and Java codes):

The first thing to realize is that by importing "String" you are
overriding the String from Java.  That's ok, except that the method
arguments to main expect java.lang.String.

Secondly, it is necessary to have a call like:
  
   Globals.env.initSwarm ("test", "0.0", "address@hidden", args);
  
..as the first call in `main', or at least before any use of the Swarm
libraries.

Thirdly, it is necessary to pass Globals.env.globalZone (or some other
zone) as an argument to Swarm constructors, e.g.

   swarm.collections.String s = new StringImpl (Globals.env.globalZone);  

Note the use of "swarm.collections.String" to differentiate from
java.lang.String.  

Don't forget to add a "import swarm.Globals" in order to
get unqualified use of the Globals class.  Otherwise you'd use 
"swarm.Globals" instead of "Globals".  

Finally, to print the swarm.collections.StringImpl you have instantiated, you
can use "Globals.env.xprint (s)".


                  ==================================
   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]