|
© 1998-2002 McGraw-Hill | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
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.
| Method Summary | |
void |
add(Object value)
Inserts value in some structure-specific location. |
void |
clear()
Removes all elements from the structure. |
boolean |
contains(Object value)
Determines if the structure contains a value. |
Enumeration |
elements()
Returns an enumeration for traversing the structure. |
boolean |
isEmpty()
Determine if there are elements within the structure. |
Iterator |
iterator()
Returns an iterator for traversing the structure. |
Object |
remove(Object value)
Removes value from the structure. |
int |
size()
Determine the size of the structure. |
Collection |
values()
Returns a java.util.Collection wrapping this structure. |
| Method Detail |
public int size()
public boolean isEmpty()
public void clear()
public boolean contains(Object value)
value - non-null value to be found within structurepublic void add(Object value)
value - the value to be added to the structure; non-nullpublic Object remove(Object value)
value - value matching the value to be removedpublic Enumeration elements()
structure package implementations return
an AbstractIteratorAbstractIterator,
Iterator,
Enumeration,
iterator()public Iterator iterator()
structure package implementations return
an AbstractIteratorAbstractIterator,
Iterator,
Enumeration,
elements()public Collection values()
Collection that may be used with
Java's Collection Framework
|
© 1998-2002 McGraw-Hill | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||