All Packages Class Hierarchy This Package Previous Next Index
Interface collections.Set
- public interface interface Set
- extends Collection
Sets provide an include operations for adding
an element only if it is not already present.
They also add a guarantee:
With sets,
you can be sure that the number of occurrences of any
element is either zero or one.
-
including(Object)
- Construct a new Collection that is a clone of self except
that it includes indicated element.
including
public abstract Set including(Object element) throws IllegalElementException
- Construct a new Collection that is a clone of self except
that it includes indicated element. This can be used
to create a series of collections, each differing from the
other only in that they contain additional elements.
- Parameters:
- element - the element to include in the new collection
- Returns:
- a new collection c, with the sameStructure as this, except that
c.includes(element)
- Throws: IllegalElementException
- if !canInclude(element)
All Packages Class Hierarchy This Package Previous Next Index