[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Creating new archiver in java Swarm
From: |
Tom Wainwright |
Subject: |
Creating new archiver in java Swarm |
Date: |
Wed, 14 Feb 2001 09:20:26 -0800 |
Hello,
I have recently gotten back to working in Swarm, specifically building a
food-web model in Java. I have tried and failed to create a new archiver
object (both lisp and hdf5 versions) in a model to record results, and seem
to have a fundamental misunderstanding of how archivers work in javaswarm.
I can't find a working example of how to do this on the web site.
First, a snippet of test code that I added to jheatbugs at the end of
buildObjects () (just before "return this") in HeatbugObserverSwarm.java.
//Test archive:
LispArchiverImpl testArch;
testArch = new LispArchiverImpl (getZone());
//LispArchiverCImpl testArch;
//testArch = new LispArchiverCImpl (getZone());
testArch.setPath("test_out.scm");
testArch.putShallow$object("testing", heatbugList);
(The commented lines are an alternative I tried that also failed.) The
code above results in a compile error:
HeatbugObserverSwarm.java:281: cannot resolve symbol
symbol : method setPath (java.lang.String)
location: class swarm.defobj.LispArchiverImpl
testArch.setPath("test_out.scm");
^
Apparently, the setPath method doesn't exist in LispArchiverImpl (nor does
create$setPath). Looking back at the reference book, I saw that these are
only in the ...CImpl classes, not the plain ...Impl classes. However,
using the CImpl classes results in an error on the creator line.
Question 1: What is the difference between CImpl and Impl classes, and
which should I be using in general?? This doesn't seem to be covered in
the refbook.
Question 2: Can someone show me how to create an archiver and write to
it? I've managed to write to the global archivers, but I want to be able
to save to a separate file.
Thanks in advance!
--
Tom Wainwright
NOAA/NMFS/NWFSC
2030 S Marine Science Dr
Newport, OR 97365 USA
address@hidden
==================================
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.
- Creating new archiver in java Swarm,
Tom Wainwright <=