Fix to ensure unmodifiable

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131696 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2004-05-03 15:13:05 +00:00
parent da463d13e7
commit 2182a43da2
1 changed files with 17 additions and 1 deletions

View File

@ -17,16 +17,18 @@ package org.apache.commons.collections.bag;
import java.util.Collection; import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set;
import org.apache.commons.collections.SortedBag; import org.apache.commons.collections.SortedBag;
import org.apache.commons.collections.Unmodifiable; import org.apache.commons.collections.Unmodifiable;
import org.apache.commons.collections.iterators.UnmodifiableIterator; import org.apache.commons.collections.iterators.UnmodifiableIterator;
import org.apache.commons.collections.set.UnmodifiableSet;
/** /**
* Decorates another <code>SortedBag</code> to ensure it can't be altered. * Decorates another <code>SortedBag</code> to ensure it can't be altered.
* *
* @since Commons Collections 3.0 * @since Commons Collections 3.0
* @version $Revision: 1.6 $ $Date: 2004/02/18 00:56:25 $ * @version $Revision: 1.7 $ $Date: 2004/05/03 15:13:05 $
* *
* @author Stephen Colebourne * @author Stephen Colebourne
*/ */
@ -86,4 +88,18 @@ public final class UnmodifiableSortedBag
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
//-----------------------------------------------------------------------
public boolean add(Object object, int count) {
throw new UnsupportedOperationException();
}
public boolean remove(Object object, int count) {
throw new UnsupportedOperationException();
}
public Set uniqueSet() {
Set set = getBag().uniqueSet();
return UnmodifiableSet.decorate(set);
}
} }