All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface collections.UpdatableBag

public interface interface UpdatableBag
extends UpdatableCollection, Bag
UpdatableBags support operations to add multiple occurrences of elements


Method Index

 o add(Object)
Add an occurrence of the indicated element to the collection.
 o addElements(Enumeration)
Add all elements of the enumeration to the collection.
 o addIfAbsent(Object)
Add an occurrence of the indicated element if it is not already present in the collection.

Methods

 o add
 public abstract void add(Object element) throws IllegalElementException
Add an occurrence of the indicated element to the collection.

Parameters:
element - the element to add
Returns:
condition:
 occurrences(element) == PREV(this).occurrencesOf(element)+1 &&
 Version change: always
 
Throws: IllegalElementException
if !canInclude(element)
 o addIfAbsent
 public abstract void addIfAbsent(Object element) throws IllegalElementException
Add an occurrence of the indicated element if it is not already present in the collection. No effect if the element is already present.

Parameters:
element - the element to add
Returns:
condition:
 occurrencesOf(element) == min(1, PREV(this).occurrencesOf(element) &&
 no spurious effects &&
 Version change iff !PREV(this).includes(element)
 
Throws: IllegalElementException
if !canInclude(element)
 o addElements
 public abstract void addElements(Enumeration e) throws IllegalElementException, CorruptedEnumerationException
Add all elements of the enumeration to the collection. Behaviorally equivalent to
 while (e.hasMoreElements()) add(e.nextElement());
 

Parameters:
e - the elements to include
Throws: IllegalElementException
if !canInclude(element)
Throws: CorruptedEnumerationException
propagated if thrown

All Packages  Class Hierarchy  This Package  Previous  Next  Index