org.apache.commons.collections.bag

Class UnmodifiableSortedBag

public final class UnmodifiableSortedBag extends AbstractSortedBagDecorator implements Unmodifiable, Serializable

Decorates another SortedBag to ensure it can't be altered.

This class is Serializable from Commons Collections 3.1.

Since: Commons Collections 3.0

Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $

Author: Stephen Colebourne

Method Summary
booleanadd(Object object)
booleanadd(Object object, int count)
booleanaddAll(Collection coll)
voidclear()
static SortedBagdecorate(SortedBag bag)
Factory method to create an unmodifiable bag.
Iteratoriterator()
booleanremove(Object object)
booleanremove(Object object, int count)
booleanremoveAll(Collection coll)
booleanretainAll(Collection coll)
SetuniqueSet()

Method Detail

add

public boolean add(Object object)

add

public boolean add(Object object, int count)

addAll

public boolean addAll(Collection coll)

clear

public void clear()

decorate

public static SortedBag decorate(SortedBag bag)
Factory method to create an unmodifiable bag.

If the bag passed in is already unmodifiable, it is returned.

Parameters: bag the bag to decorate, must not be null

Returns: an unmodifiable SortedBag

Throws: IllegalArgumentException if bag is null

iterator

public Iterator iterator()

remove

public boolean remove(Object object)

remove

public boolean remove(Object object, int count)

removeAll

public boolean removeAll(Collection coll)

retainAll

public boolean retainAll(Collection coll)

uniqueSet

public Set uniqueSet()
Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.