Download from isi.edu - Information Sciences Institute
Transcript
Chapter 6: PowerLoom API
67
while (iter.nextP()) {
System.out.println(PLI.getNthString(iter, 1, null, null) + " is " +
PLI.getNthInteger(iter, 2, null, null ) + " years old.");
}
6.2.3.10 Utility Classes for Java
To make interoperation of Stella and Java easier, there are several convenience classes for
wrapping Stella iterators and having them behave like Java enumerations or iterators. These
convenience classes are in the edu.isi.stella.javalib package:
ConsEnumeration.java
Enumeration class for Cons objects
ConsIterator.java
Iterator class for Cons objects
StellaEnumeration.java
Enumeration interface to Stella’s Iterator
StellaIterator.java
Iterator interface to Stella’s Iterator
All of the iterators and enumerators return objects that are actually of type Stella_
Object, but the signature specifies java.lang.Object as required for compatibility with
the standard Java signature. The Cons... classes take a Cons in their constructor. The
Stella... classes take a edu.isi.stella.Iterator object in their constructor.