All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Interface structure.Collection

public interface Collection
extends Store
An interface for structures that allow you to add, remove, and check for containment. Many structures in the structure package are efficiently implemented if you can limit your usage to this interface.


Method Index

 o add(Object)
Add a value to the structure.
 o contains(Object)
Determine if the structure contains a value.
 o elements()
Construct an iterator over the elements of the structure.
 o remove(Object)
Remove a value from the store.

Methods

 o contains
public abstract boolean contains(Object value)
Determine if the structure contains a value.

Precondition:
value is non-null
Postcondition:
returns true iff the collection contains the value

Parameters:
value - The value sought.
Returns:
True if the structure contains the value.
 o add
public abstract void add(Object value)
Add a value to the structure.

Precondition:
value is non-null
Postcondition:
the value is added to the collection the replacement policy is not specified.

Parameters:
value - The value to be added.
 o remove
public abstract Object remove(Object value)
Remove a value from the store.

Precondition:
value is non-null
Postcondition:
removes an object "equal" to value within collection.

Parameters:
value - The value to be removed.
Returns:
The value actually removed.
 o elements
public abstract Iterator elements()
Construct an iterator over the elements of the structure.

Postcondition:
returns an iterator for traversing collection

Returns:
An iterator over the structure.

All Packages  Class Hierarchy  This Package  Previous  Next  Index