jdsl.core.api
Interface Container

All Known Subinterfaces:
BinaryTree, BookSequence, CircularSequence, Dictionary, Graph, InspectableBinaryTree, InspectableGraph, InspectableTree, KeyBasedContainer, OrderedDictionary, PositionalContainer, PositionalSequence, PriorityQueue, RestructurableBinaryTree, Sequence, Tree

public abstract interface Container
extends Container

A container is a collection of elements, each of which is a generic Object. An element can be stored multiple times in a container.

This is the base interface for all the container interfaces in the "core" package (e.g., Sequence, PriorityQueue), by way of the subinterfaces PositionalContainer and KeyBasedContainer.

Author:
Michael T. Goodrich, Mark Handy, Roberto Tamassia
See Also:
PositionalContainer, KeyBasedContainer, Container

Method Summary
 java.util.Enumeration elements()
          Returns an enumeration of the elements stored in the container.
 Container newContainer()
          Instantiates another container of the same class (without knowing the class).
 
Methods inherited from interface jdsl.simple.api.SimpleContainer
isEmpty, size
 

Method Detail

elements

public java.util.Enumeration elements()
Returns an enumeration of the elements stored in the container. Duplicated elements appear in the enumeration as many times as they are held in the container. For some containers, the order of the elements in the enumeration is arbitrary, but for some it is defined.
Returns:
Enumeration of all elements in the container

newContainer

public Container newContainer()
                       throws InvalidContainerException
Instantiates another container of the same class (without knowing the class).
Returns:
a new instance of the class of the container on which the method is called