// Interface of a basic, mutable data structure. // (c) 2001 duane a. bailey package structure; import java.util.Iterator; import java.util.Collection; /* JDT added extension of Iterable for Java 5 */ /** * The interface of a basic, mutable data structure. *
* This interface is the basis for most mutable structures in the structure
* package. While most methods are easy implement, it is often sufficient
* to simply extend a basic, abstract implementation of this class, the
* AbstractStructure. The AbstractStructure implements the isEmpty,
* contains and collection methods. They may be overridden if a particularly
* efficient technique is to be preferred.
*
* @author, 2001 duane a. bailey
* @version $Id: Structure.java,v 1.3 2005/10/18 19:47:24 terescoj Exp $
* @since Java Structures, 2nd edition
*/
//+interface
public interface Structurestructure
package implementations return
* an AbstractIterator
* @return an enumeration for traversing the structure
* @see AbstractIterator
* @see java.util.Iterator
* @see java.util.Enumeration
* @see #iterator
*/
public java.util.Enumeration elements();
/**
* Returns an iterator for traversing the structure.
*
* @post returns an iterator for traversing structure;
* all structure
package implementations return
* an AbstractIterator
* @return an iterator for traversing the structure
* @see AbstractIterator
* @see java.util.Iterator
* @see java.util.Enumeration
* @see #elements
*/
public IteratorCollection
that may be used with
* Java's Collection Framework
* @return a Collection that is equivalent to this structure
*/
public Collection