This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> I received mail stating that I should take a look at your progress > on a Java NetCDF interface. I've taken a quick look (I'll spend some > more time later) and I have a few preliminary observations/questions. > > 1). Will this use/need JDK 1.1? Yes. Inner classes are used in the implementation, and no attempt was made to limit use of the java.* classes & interfaces to those available prior to 1.1 > 2). I was curious about how you've changed the objects from the C++ way > of doing things. For instance, in C++, the Variable object gets/puts > data as well as tells you about the variable in question. This is not > the case in the Java version. I found it very intuitive the C++ way; > once you got a variable, you could do any operation on it. Why is > it necessary to still deal with the Netcdf class to actually get/put > data? There are a couple of reasons for this. "Variables which do I/O" don't exist independent of a netcdf file in the current C++ implementation. It seems to me to be a mistake to allow construction of an object (Variable in this case) which has some of it's methods unavailable until/unless it is "bound" to a netcdf file or other service. The java interface separates the Variable description (just called "Variable") from the i/o interface (ArrayInput, ArrayOutput). The container which provides the I/O service (a netcdf file) is a factory for these interface objects. In practice, it isn't much different from what you were doing before. You ask for an object to do I/O with by name. In terms of it's state information, the I/O object is more abstract than a netcdf variable, but you can still inquire the info you are most likely to need at I/O time: rank, dimension sizes, etc. Variable, ArrayInput, and ArrayOutput all derive from MultiArray. > 3). Maybe I didn't look hard enough, but are there classes to create > NetCDF files? NetcdfV1File. The constructors to create a netcdf file are those which have Variable [], Attribute [] or VariableSet arguments. > 4). What will the capabilities of the Iterator class(es) be? Javadoc is not currently generating documentation for inner classes. For XXX in {Dimension, Attribute, Variable} public interface XXXSet.Iterator { /** * Returns <code>true</code> if there are more elements. */ boolean hasNext(); /** * Returns the next element. Calls to this * method will step through successive elements. * @exception NoSuchElementException If no more elements exist. */ XXX next(); } The method names are from the proposed java.util.Iterator class in the Containers proposal. Iterator is to replace or supplant java.util.Enumeration. > I guess that's all I have right now. I wanted to thank you for asking > me to take a look at things. I've been using the Alpha version of > Jave NetCDF (done by Joe Sirrott I believe). It would be a great help > to have a version that can write files as well. :) -glenn