Remove incorrect comment about using hashCode to determine whether
objects in the bag are equal. Fix numerous javadoc cross reference problems. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130642 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cfb9865f41
commit
008dc5f8da
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Bag.java,v 1.4 2002/03/13 05:40:30 mas Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Bag.java,v 1.5 2002/03/13 06:00:20 mas Exp $
|
||||||
* $Revision: 1.4 $
|
* $Revision: 1.5 $
|
||||||
* $Date: 2002/03/13 05:40:30 $
|
* $Date: 2002/03/13 06:00:20 $
|
||||||
*
|
*
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
|
@ -66,11 +66,10 @@ import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link Collection} that keeps a count of its members of the same
|
* A {@link Collection} that counts the number of times an object appears in
|
||||||
* type, using <code>hashCode</code> to check for equality. Suppose
|
* the collection. Suppose you have a Bag that contains <code>{a, a, b,
|
||||||
* you have a Bag that contains <code>{a, a, b, c}</code>. Calling
|
* c}</code>. Calling {@link #getCount(Object)} on <code>a</code> would return
|
||||||
* {@link #getCount} on <code>a</code> would return 2, while calling
|
* 2, while calling {@link #uniqueSet()} would return <code>{a, b, c}</code>.
|
||||||
* {@link #uniqueSet} would return <code>{a, b, c}</code>.
|
|
||||||
*
|
*
|
||||||
* @author Chuck Burdick
|
* @author Chuck Burdick
|
||||||
**/
|
**/
|
||||||
|
@ -84,12 +83,12 @@ public interface Bag extends Collection {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the given object to the bag and keep a count. If the object
|
* Add the given object to the bag and keep a count. If the object
|
||||||
* is already in the {@link #uniqueSet} then increment its count as
|
* is already in the {@link #uniqueSet()} then increment its count as
|
||||||
* reported by {@link #getCount}. Otherwise add it to the {@link
|
* reported by {@link #getCount(Object)}. Otherwise add it to the {@link
|
||||||
* #uniqueSet} and report its count as 1.
|
* #uniqueSet()} and report its count as 1.
|
||||||
* @return <code>true</code> if the object was not already in the
|
* @return <code>true</code> if the object was not already in the
|
||||||
* <code>uniqueSet</code>
|
* <code>uniqueSet</code>
|
||||||
* @see #getCount
|
* @see #getCount(Object)
|
||||||
**/
|
**/
|
||||||
public boolean add(Object o);
|
public boolean add(Object o);
|
||||||
|
|
||||||
|
@ -99,13 +98,13 @@ public interface Bag extends Collection {
|
||||||
* @return <code>true</code> if the object was not already in the
|
* @return <code>true</code> if the object was not already in the
|
||||||
* <code>uniqueSet</code>
|
* <code>uniqueSet</code>
|
||||||
* @see #add(Object)
|
* @see #add(Object)
|
||||||
* @see #getCount
|
* @see #getCount(Object)
|
||||||
**/
|
**/
|
||||||
public boolean add(Object o, int i);
|
public boolean add(Object o, int i);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all occurrences of the given object from the bag, and do
|
* Remove all occurrences of the given object from the bag, and do
|
||||||
* not represent the object in the {@link #uniqueSet}.
|
* not represent the object in the {@link #uniqueSet()}.
|
||||||
* @see #remove(Object, int)
|
* @see #remove(Object, int)
|
||||||
* @return <code>true</code> if this call changed the collection
|
* @return <code>true</code> if this call changed the collection
|
||||||
**/
|
**/
|
||||||
|
@ -114,8 +113,8 @@ public interface Bag extends Collection {
|
||||||
/**
|
/**
|
||||||
* Remove the given number of occurrences from the bag. If the bag
|
* Remove the given number of occurrences from the bag. If the bag
|
||||||
* contains <code>i</code> occurrences or less, the item will be
|
* contains <code>i</code> occurrences or less, the item will be
|
||||||
* removed from the {@link #uniqueSet}.
|
* removed from the {@link #uniqueSet()}.
|
||||||
* @see #getCount
|
* @see #getCount(Object)
|
||||||
* @see #remove(Object)
|
* @see #remove(Object)
|
||||||
* @return <code>true</code> if this call changed the collection
|
* @return <code>true</code> if this call changed the collection
|
||||||
**/
|
**/
|
||||||
|
@ -130,7 +129,6 @@ public interface Bag extends Collection {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the total number of items in the bag across all types.
|
* Returns the total number of items in the bag across all types.
|
||||||
* @see #size
|
|
||||||
**/
|
**/
|
||||||
public int size();
|
public int size();
|
||||||
|
|
||||||
|
@ -138,8 +136,8 @@ public interface Bag extends Collection {
|
||||||
* Returns <code>true</code> if the bag contains all elements in
|
* Returns <code>true</code> if the bag contains all elements in
|
||||||
* the given collection, respecting cardinality. That is, if the
|
* the given collection, respecting cardinality. That is, if the
|
||||||
* given collection <code>C</code> contains <code>n</code> copies
|
* given collection <code>C</code> contains <code>n</code> copies
|
||||||
* of a given object, calling {@link #getCount} on that object must
|
* of a given object, calling {@link #getCount(Object)} on that object must
|
||||||
* be >= <code>n</code> for all <code>n</code> in <code>C</code>.
|
* be <code>>= n</code> for all <code>n</code> in <code>C</code>.
|
||||||
**/
|
**/
|
||||||
public boolean containsAll(Collection c);
|
public boolean containsAll(Collection c);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue