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