swarm-support
[Top][All Lists]
Advanced

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

Re: swarm lib


From: Alex Lancaster
Subject: Re: swarm lib
Date: 28 May 2002 23:06:20 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

>>>>> "CC" == Cindy Chen <address@hidden> writes:

CC> Hello, I am Cindy from UCSF.  I have been working on my own simple
CC> swarm progams.  I am confused in using some swarm lib(Java). I
CC> wrote a simple program below (it works if I use only Java lib and
CC> Java codes): ---------------------------------------- import
CC> swarm.collections.String; import swarm.collections.StringImpl;

CC> class test { public static void main (String args[]) { test
CC> bug=new test(); } public test() { String s=new StringImpl();
CC> s.catC("abc"); } } ----------------------------------------- There
CC> is no compile error. When running it shows:failed to locate native
CC> function
CC> swarm/random/uniformintegerDistImpl.getIntegerMin()I. What do I
CC> miss out?  Each package has 2 parts: interfaces and Implementing
CC> Classes.  

Are you using the "javacswarm" to compile your programs, and using
"javaswarm" to run the resulting class file?  (You can't use the usual
"java" to run the class file, because it doesn't have the logic to set
the location for the shared library [GNU/Linux] or DLL [Windows] which
contains the native code).

It would help if you posted the following:

1. Operating system/platform  version you are using.

2. The exact command-line you are using to run the program and the
   output that results (cut and paste it from the terminal window).

If you're new to Swarm you should check out Paul Johnson's FAQ:

 http://lark.cc.ukans.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html

CC> I wonder what *Impl do. Interfaces are classes and within one
CC> interface there are some methods. How can I get the interface
CC> implemented and use the methods?

*Impl are simply classes that "implement" the given interface.
"SwarmImpl" then "implements" the "Swarm" interface.  *Impl objects
can be instantiated, but interfaces cannot.  This is simply standard
Java, the twist is that all "instantiatable" classes in Swarm use the
"Impl" suffix to indicate a class consistently.

CC> Please advice me.  Thanks. I appreciate your help.  Cindy

Alex
-- 
  Alex Lancaster           |  
  Swarm Development Group  |     web: http://www.swarm.org
-------------------------------------------------------------------

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