⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.bag

Class UnmodifiableBag

java.lang.Object
|
+--org.apache.commons.collections.collection.AbstractCollectionDecorator
   |
   +--org.apache.commons.collections.bag.AbstractBagDecorator
      |
      +--org.apache.commons.collections.bag.UnmodifiableBag

All Implemented Interfaces:
Collection, Bag, Unmodifiable


public final class UnmodifiableBag
extends AbstractBagDecorator
implements Unmodifiable

Decorates another Bag to ensure it can't be altered.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Method Summary

boolean

add(Object object)

boolean

add(Object object, int count)

boolean

addAll(Collection coll)

void

clear()

static Bag

decorate(Bag bag)

Factory method to create an unmodifiable bag.

Iterator

iterator()

boolean

remove(Object object)

boolean

remove(Object object, int count)

boolean

removeAll(Collection coll)

boolean

retainAll(Collection coll)

Set

uniqueSet()

Method Details

add

public boolean add(Object object, int count)

Parameters:
object
count

add

public boolean add(Object object)

Parameters:
object

addAll

public boolean addAll(Collection coll)

Parameters:
coll

clear

public void clear()


decorate

public static Bag decorate(Bag bag)

Factory method to create an unmodifiable bag.

Parameters:
bag - the bag to decorate, must not be null
Throws:
- if bag is null

iterator

public Iterator iterator()


remove

public boolean remove(Object object, int count)

Parameters:
object
count

remove

public boolean remove(Object object)

Parameters:
object

removeAll

public boolean removeAll(Collection coll)

Parameters:
coll

retainAll

public boolean retainAll(Collection coll)

Parameters:
coll

uniqueSet

public Set uniqueSet()