scolebourne 2004/05/15 05:27:04
Modified: collections/src/java/org/apache/commons/collections/bag
TransformedBag.java UnmodifiableSortedBag.java
SynchronizedSortedBag.java PredicatedBag.java
TypedBag.java TypedSortedBag.java
SynchronizedBag.java PredicatedSortedBag.java
UnmodifiableBag.java AbstractMapBag.java
TransformedSortedBag.java
Log:
Javadoc
Revision Changes Path
1.5 +2 -1
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/TransformedBag.java
Index: TransformedBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/TransformedBag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TransformedBag.java 18 Feb 2004 00:56:25 -0000 1.4
+++ TransformedBag.java 15 May 2004 12:27:04 -0000 1.5
@@ -46,6 +46,7 @@
*
* @param bag the bag to decorate, must not be null
* @param transformer the transformer to use for conversion, must not be null
+ * @return a new transformed Bag
* @throws IllegalArgumentException if bag or transformer is null
*/
public static Bag decorate(Bag bag, Transformer transformer) {
1.8 +4 -1
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/UnmodifiableSortedBag.java
Index: UnmodifiableSortedBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/UnmodifiableSortedBag.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- UnmodifiableSortedBag.java 3 May 2004 15:13:05 -0000 1.7
+++ UnmodifiableSortedBag.java 15 May 2004 12:27:04 -0000 1.8
@@ -37,8 +37,11 @@
/**
* Factory method to create an unmodifiable bag.
+ * <p>
+ * If the bag passed in is already unmodifiable, it is returned.
*
* @param bag the bag to decorate, must not be null
+ * @return an unmodifiable SortedBag
* @throws IllegalArgumentException if bag is null
*/
public static SortedBag decorate(SortedBag bag) {
1.6 +7 -1
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/SynchronizedSortedBag.java
Index: SynchronizedSortedBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/SynchronizedSortedBag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SynchronizedSortedBag.java 18 Feb 2004 00:56:25 -0000 1.5
+++ SynchronizedSortedBag.java 15 May 2004 12:27:04 -0000 1.6
@@ -39,6 +39,7 @@
* Factory method to create a synchronized sorted bag.
*
* @param bag the bag to decorate, must not be null
+ * @return a new synchronized SortedBag
* @throws IllegalArgumentException if bag is null
*/
public static SortedBag decorate(SortedBag bag) {
@@ -67,6 +68,11 @@
super(bag, lock);
}
+ /**
+ * Gets the bag being decorated.
+ *
+ * @return the decorated bag
+ */
protected SortedBag getSortedBag() {
return (SortedBag) collection;
}
1.5 +2 -1
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/PredicatedBag.java
Index: PredicatedBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/PredicatedBag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PredicatedBag.java 18 Feb 2004 00:56:25 -0000 1.4
+++ PredicatedBag.java 15 May 2004 12:27:04 -0000 1.5
@@ -45,6 +45,7 @@
*
* @param bag the bag to decorate, must not be null
* @param predicate the predicate to use for validation, must not be null
+ * @return a new predicated Bag
* @throws IllegalArgumentException if bag or predicate is null
* @throws IllegalArgumentException if the bag contains invalid elements
*/
1.6 +3 -1
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/TypedBag.java
Index: TypedBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/TypedBag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TypedBag.java 7 May 2004 23:28:38 -0000 1.5
+++ TypedBag.java 15 May 2004 12:27:04 -0000 1.6
@@ -42,6 +42,7 @@
*
* @param bag the bag to decorate, must not be null
* @param type the type to allow into the bag, must not be null
+ * @return a new typed Bag
* @throws IllegalArgumentException if bag or type is null
* @throws IllegalArgumentException if the bag contains invalid elements
*/
@@ -53,6 +54,7 @@
* Restrictive constructor.
*/
protected TypedBag() {
+ super();
}
}
1.6 +3 -1
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/TypedSortedBag.java
Index: TypedSortedBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/TypedSortedBag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TypedSortedBag.java 7 May 2004 23:28:38 -0000 1.5
+++ TypedSortedBag.java 15 May 2004 12:27:04 -0000 1.6
@@ -42,6 +42,7 @@
*
* @param bag the bag to decorate, must not be null
* @param type the type to allow into the bag, must not be null
+ * @return a new transformed SortedBag
* @throws IllegalArgumentException if bag or type is null
* @throws IllegalArgumentException if the bag contains invalid elements
*/
@@ -53,6 +54,7 @@
* Restrictive constructor.
*/
protected TypedSortedBag() {
+ super();
}
}
1.6 +12 -1
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/SynchronizedBag.java
Index: SynchronizedBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/SynchronizedBag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SynchronizedBag.java 18 Feb 2004 00:56:25 -0000 1.5
+++ SynchronizedBag.java 15 May 2004 12:27:04 -0000 1.6
@@ -40,6 +40,7 @@
* Factory method to create a synchronized bag.
*
* @param bag the bag to decorate, must not be null
+ * @return a new synchronized Bag
* @throws IllegalArgumentException if bag is null
*/
public static Bag decorate(Bag bag) {
@@ -68,6 +69,11 @@
super(bag, lock);
}
+ /**
+ * Gets the bag being decorated.
+ *
+ * @return the decorated bag
+ */
protected Bag getBag() {
return (Bag) collection;
}
@@ -103,6 +109,11 @@
* Synchronized Set for the Bag class.
*/
class SynchronizedBagSet extends SynchronizedSet {
+ /**
+ * Constructor.
+ * @param set the set to decorate
+ * @param lock the lock to use, shared with the bag
+ */
SynchronizedBagSet(Set set, Object lock) {
super(set, lock);
}
1.5 +2 -1
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/PredicatedSortedBag.java
Index: PredicatedSortedBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/PredicatedSortedBag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PredicatedSortedBag.java 18 Feb 2004 00:56:25 -0000 1.4
+++ PredicatedSortedBag.java 15 May 2004 12:27:04 -0000 1.5
@@ -44,6 +44,7 @@
*
* @param bag the bag to decorate, must not be null
* @param predicate the predicate to use for validation, must not be null
+ * @return a new predicated SortedBag
* @throws IllegalArgumentException if bag or predicate is null
* @throws IllegalArgumentException if the bag contains invalid elements
*/
1.7 +4 -1
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/UnmodifiableBag.java
Index: UnmodifiableBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/UnmodifiableBag.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- UnmodifiableBag.java 18 Feb 2004 00:56:25 -0000 1.6
+++ UnmodifiableBag.java 15 May 2004 12:27:04 -0000 1.7
@@ -37,8 +37,11 @@
/**
* Factory method to create an unmodifiable bag.
+ * <p>
+ * If the bag passed in is already unmodifiable, it is returned.
*
* @param bag the bag to decorate, must not be null
+ * @return an unmodifiable Bag
* @throws IllegalArgumentException if bag is null
*/
public static Bag decorate(Bag bag) {
1.15 +24 -4
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/AbstractMapBag.java
Index: AbstractMapBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/AbstractMapBag.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- AbstractMapBag.java 18 Feb 2004 00:56:25 -0000 1.14
+++ AbstractMapBag.java 15 May 2004 12:27:04 -0000 1.15
@@ -76,8 +76,9 @@
/**
* Utility method for implementations to access the map that backs
- * this bag. Not intended for interactive use outside of
- * subclasses.
+ * this bag. Not intended for interactive use outside of subclasses.
+ *
+ * @return the map being used by the Bag
*/
protected Map getMap() {
return map;
@@ -171,6 +172,9 @@
return new BagIterator(this);
}
+ /**
+ * Inner class iterator for the Bag.
+ */
static class BagIterator implements Iterator {
private AbstractMapBag parent;
private Iterator entryIterator;
@@ -179,6 +183,11 @@
private final int mods;
private boolean canRemove;
+ /**
+ * Constructor.
+ *
+ * @param parent the parent bag
+ */
public BagIterator(AbstractMapBag parent) {
this.parent = parent;
this.entryIterator = parent.map.entrySet().iterator();
@@ -391,8 +400,13 @@
* Mutable integer class for storing the data.
*/
protected static class MutableInteger {
+ /** The value of this mutable. */
protected int value;
+ /**
+ * Constructor.
+ * @param value the initial value
+ */
MutableInteger(int value) {
this.value = value;
}
@@ -469,6 +483,8 @@
//-----------------------------------------------------------------------
/**
* Write the map out using a custom routine.
+ * @param out the output stream
+ * @throws IOException
*/
protected void doWriteObject(ObjectOutputStream out) throws IOException {
out.writeInt(map.size());
@@ -481,6 +497,10 @@
/**
* Read the map in using a custom routine.
+ * @param map the map to use
+ * @param in the input stream
+ * @throws IOException
+ * @throws ClassNotFoundException
*/
protected void doReadObject(Map map, ObjectInputStream in) throws IOException,
ClassNotFoundException {
this.map = map;
@@ -514,7 +534,7 @@
return false;
}
for (Iterator it = map.keySet().iterator(); it.hasNext();) {
- Object element = (Object) it.next();
+ Object element = it.next();
if (other.getCount(element) != getCount(element)) {
return false;
}
1.5 +2 -1
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/TransformedSortedBag.java
Index: TransformedSortedBag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/TransformedSortedBag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TransformedSortedBag.java 18 Feb 2004 00:56:25 -0000 1.4
+++ TransformedSortedBag.java 15 May 2004 12:27:04 -0000 1.5
@@ -44,6 +44,7 @@
*
* @param bag the bag to decorate, must not be null
* @param transformer the transformer to use for conversion, must not be null
+ * @return a new transformed SortedBag
* @throws IllegalArgumentException if bag or transformer is null
*/
public static SortedBag decorate(SortedBag bag, Transformer transformer) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]