Opus5
Interface Container
- All Superinterfaces:
- Comparable
- All Known Subinterfaces:
- Deque, Digraph, DoubleEndedPriorityQueue, Graph, HashTable, MergeablePriorityQueue, Multiset, OrderedList, Partition, PriorityQueue, Queue, SearchableContainer, SearchTree, Set, SortedList, Stack, Tree
- All Known Implementing Classes:
- AbstractContainer
- public interface Container
- extends Comparable
Encapsulates methods common to all container classes.
- Version:
- $Id: Container.java,v 3.2 1998/07/28 02:24:04 brpreiss Exp $
- Author:
- Bruno R. Preiss, P.Eng.
|
Field Summary |
static java.lang.String |
copyright
|
|
Method Summary |
void |
accept(Visitor visitor)
Causes a visitor to visit the objects in this container. |
int |
getCount()
Returns the number of objects in this container. |
Enumeration |
getEnumeration()
Returns an enumeration that enumerates the objects in this container. |
boolean |
isEmpty()
Tests whether this container is empty. |
boolean |
isFull()
Tests whether this container is full. |
void |
purge()
Makes this container empty. |
copyright
public static final java.lang.String copyright
getCount
public int getCount()
- Returns the number of objects in this container.
- Returns:
- The number of objects in this container.
isEmpty
public boolean isEmpty()
- Tests whether this container is empty.
- Returns:
- True if the container is empty; false if it is not.
isFull
public boolean isFull()
- Tests whether this container is full.
- Returns:
- True if the container is full; false if it is not.
purge
public void purge()
- Makes this container empty.
All references to contained objects are dropped.
Thus, the contained objects may be garbage collected.
accept
public void accept(Visitor visitor)
- Causes a visitor to visit the objects in this container.
This method takes a visitor and,
as long as the IsDone method of that visitor returns false,
this method invokes the Visit method of the visitor
for each object in this container.
- Parameters:
visitor - The visitor to accept.- See Also:
Visitor
getEnumeration
public Enumeration getEnumeration()
- Returns an enumeration that enumerates the objects in this container.
- Returns:
- An enumeration that enumerates the objects in this container.
- See Also:
Enumeration