jdsl.simple.api
Interface SimpleContainer

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

public abstract interface SimpleContainer

Interface for a generic 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 interface in the "simple" package defines only the basic methods of a container.

Author:
Michael T. Goodrich, Mark Handy, Roberto Tamassia
See Also:
RankedSequence, PriorityQueue, Dictionary, Container

Method Summary
 boolean isEmpty()
          Tests if the container is empty.
 int size()
          Return the number of elements stored in the container, where each element is counted according to is multiplicity.
 

Method Detail

size

public int size()
Return the number of elements stored in the container, where each element is counted according to is multiplicity.
Returns:
number of elements in the container.

isEmpty

public boolean isEmpty()
Tests if the container is empty.
Returns:
true if the container is empty, false otherwise.