diff --git a/src/java/org/apache/commons/collections/Bag.java b/src/java/org/apache/commons/collections/Bag.java index 18205fe65..05e6f3e8d 100644 --- a/src/java/org/apache/commons/collections/Bag.java +++ b/src/java/org/apache/commons/collections/Bag.java @@ -38,13 +38,14 @@ import java.util.Set; * In an ideal world, the interface would be changed to fix the problems, however * it has been decided to maintain backwards compatibility instead. * + * @param the type held in the bag * @since Commons Collections 2.0 * @version $Revision$ $Date$ * * @author Chuck Burdick * @author Stephen Colebourne */ -public interface Bag extends Collection { +public interface Bag extends Collection { /** * Returns the number of occurrences (cardinality) of the given @@ -72,7 +73,7 @@ public interface Bag extends Collection { * @param object the object to add * @return true if the object was not already in the uniqueSet */ - boolean add(Object object); + boolean add(E object); /** * Adds nCopies copies of the specified object to the Bag. @@ -85,7 +86,7 @@ public interface Bag extends Collection { * @param nCopies the number of copies to add * @return true if the object was not already in the uniqueSet */ - boolean add(Object object, int nCopies); + boolean add(E object, int nCopies); /** * (Violation) @@ -120,7 +121,7 @@ public interface Bag extends Collection { * * @return the Set of unique Bag elements */ - Set uniqueSet(); + Set uniqueSet(); /** * Returns the total number of items in the bag across all types. @@ -145,7 +146,7 @@ public interface Bag extends Collection { * @param coll the collection to check against * @return true if the Bag contains all the collection */ - boolean containsAll(Collection coll); + boolean containsAll(Collection coll); /** * (Violation) @@ -163,7 +164,7 @@ public interface Bag extends Collection { * @param coll the collection to remove * @return true if this call changed the collection */ - boolean removeAll(Collection coll); + boolean removeAll(Collection coll); /** * (Violation) @@ -184,7 +185,7 @@ public interface Bag extends Collection { * @param coll the collection to retain * @return true if this call changed the collection */ - boolean retainAll(Collection coll); + boolean retainAll(Collection coll); /** * Returns an {@link Iterator} over the entire set of members, @@ -193,7 +194,7 @@ public interface Bag extends Collection { * * @return iterator over all elements in the Bag */ - Iterator iterator(); + Iterator iterator(); // The following is not part of the formal Bag interface, however where possible // Bag implementations should follow these comments. @@ -218,5 +219,5 @@ public interface Bag extends Collection { // * @return the hash code of the Bag // */ // int hashCode(); - + }