mirror of
https://github.com/apache/commons-collections.git
synced 2025-02-16 15:07:17 +00:00
Clarify the internal workings of the predicated decorator from the Utils classes
bug 28115 git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131619 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6e220f8a84
commit
f34f3d2cff
@ -52,4 +52,5 @@ No interface changes, or deprecations have occurred.
|
||||
<li>TreeBidiMap - Add javadoc about requiring Comparable entries [26470]</li>
|
||||
<li>MultiKey - Add extra explanatations, examples and warnings</li>
|
||||
<li>MultiMap,MultiHashMap - Add extra documentation to clarify the interface and implementation</li>
|
||||
<li>XxxUtils - Clarify the internal workings of the predicated decorator classes [28115]</li>
|
||||
</ul>
|
||||
|
@ -33,7 +33,7 @@ import org.apache.commons.collections.bag.UnmodifiableSortedBag;
|
||||
* {@link Bag} and {@link SortedBag} instances.
|
||||
*
|
||||
* @since Commons Collections 2.1
|
||||
* @version $Revision: 1.19 $ $Date: 2004/02/18 01:15:42 $
|
||||
* @version $Revision: 1.20 $ $Date: 2004/04/01 20:12:00 $
|
||||
*
|
||||
* @author Paul Jack
|
||||
* @author Stephen Colebourne
|
||||
@ -104,10 +104,12 @@ public class BagUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a predicated bag backed by the given bag. Only objects
|
||||
* that pass the test in the given predicate can be added to the bag.
|
||||
* It is important not to use the original bag after invoking this
|
||||
* method, as it is a backdoor for adding unvalidated objects.
|
||||
* Returns a predicated (validating) bag backed by the given bag.
|
||||
* <p>
|
||||
* Only objects that pass the test in the given predicate can be added to the bag.
|
||||
* Trying to add an invalid object results in an IllegalArgumentException.
|
||||
* It is important not to use the original bag after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param bag the bag to predicate, must not be null
|
||||
* @param predicate the predicate for the bag, must not be null
|
||||
@ -193,11 +195,12 @@ public class BagUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a predicated sorted bag backed by the given sorted bag.
|
||||
* Only objects that pass the test in the given predicate can be
|
||||
* added to the bag.
|
||||
* It is important not to use the original bag after invoking this
|
||||
* method, as it is a backdoor for adding unvalidated objects.
|
||||
* Returns a predicated (validating) sorted bag backed by the given sorted bag.
|
||||
* <p>
|
||||
* Only objects that pass the test in the given predicate can be added to the bag.
|
||||
* Trying to add an invalid object results in an IllegalArgumentException.
|
||||
* It is important not to use the original bag after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param bag the sorted bag to predicate, must not be null
|
||||
* @param predicate the predicate for the bag, must not be null
|
||||
|
@ -26,7 +26,7 @@ import org.apache.commons.collections.buffer.UnmodifiableBuffer;
|
||||
* Provides utility methods and decorators for {@link Buffer} instances.
|
||||
*
|
||||
* @since Commons Collections 2.1
|
||||
* @version $Revision: 1.19 $ $Date: 2004/02/18 01:15:43 $
|
||||
* @version $Revision: 1.20 $ $Date: 2004/04/01 20:12:00 $
|
||||
*
|
||||
* @author Paul Jack
|
||||
* @author Stephen Colebourne
|
||||
@ -97,11 +97,12 @@ public class BufferUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a predicated buffer backed by the given buffer. Elements are
|
||||
* evaluated with the given predicate before being added to the buffer.
|
||||
* If the predicate evaluation returns false, then an
|
||||
* IllegalArgumentException is raised and the element is not added to
|
||||
* the buffer.
|
||||
* Returns a predicated (validating) buffer backed by the given buffer.
|
||||
* <p>
|
||||
* Only objects that pass the test in the given predicate can be added to the buffer.
|
||||
* Trying to add an invalid object results in an IllegalArgumentException.
|
||||
* It is important not to use the original buffer after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param buffer the buffer to predicate, must not be null
|
||||
* @param predicate the predicate used to evaluate new elements, must not be null
|
||||
|
@ -37,7 +37,7 @@ import org.apache.commons.collections.collection.UnmodifiableCollection;
|
||||
* Provides utility methods and decorators for {@link Collection} instances.
|
||||
*
|
||||
* @since Commons Collections 1.0
|
||||
* @version $Revision: 1.58 $ $Date: 2004/03/31 23:13:50 $
|
||||
* @version $Revision: 1.59 $ $Date: 2004/04/01 20:12:00 $
|
||||
*
|
||||
* @author Rodney Waldhoff
|
||||
* @author Paul Jack
|
||||
@ -1019,13 +1019,12 @@ public class CollectionUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a predicated collection backed by the given collection.
|
||||
* Only objects that pass the test in the given predicate can be
|
||||
* added to the collection. Throws an IllegalArgumentException on adding
|
||||
* an element if it is invalid.
|
||||
* Returns a predicated (validating) collection backed by the given collection.
|
||||
* <p>
|
||||
* It is important not to use the original collection after invoking this
|
||||
* method, as it is a backdoor for adding unvalidated objects.
|
||||
* Only objects that pass the test in the given predicate can be added to the collection.
|
||||
* Trying to add an invalid object results in an IllegalArgumentException.
|
||||
* It is important not to use the original collection after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param collection the collection to predicate, must not be null
|
||||
* @param predicate the predicate for the collection, must not be null
|
||||
|
@ -33,7 +33,7 @@ import org.apache.commons.collections.list.UnmodifiableList;
|
||||
* Provides utility methods and decorators for {@link List} instances.
|
||||
*
|
||||
* @since Commons Collections 1.0
|
||||
* @version $Revision: 1.27 $ $Date: 2004/02/18 01:15:42 $
|
||||
* @version $Revision: 1.28 $ $Date: 2004/04/01 20:12:00 $
|
||||
*
|
||||
* @author Federico Barbieri
|
||||
* @author Peter Donald
|
||||
@ -259,10 +259,12 @@ public class ListUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a predicated list backed by the given list. Only objects
|
||||
* that pass the test in the given predicate can be added to the list.
|
||||
* It is important not to use the original list after invoking this
|
||||
* method, as it is a backdoor for adding unvalidated objects.
|
||||
* Returns a predicated (validating) list backed by the given list.
|
||||
* <p>
|
||||
* Only objects that pass the test in the given predicate can be added to the list.
|
||||
* Trying to add an invalid object results in an IllegalArgumentException.
|
||||
* It is important not to use the original list after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param list the list to predicate, must not be null
|
||||
* @param predicate the predicate for the list, must not be null
|
||||
|
@ -67,7 +67,7 @@ import org.apache.commons.collections.map.UnmodifiableSortedMap;
|
||||
* </ul>
|
||||
*
|
||||
* @since Commons Collections 1.0
|
||||
* @version $Revision: 1.44 $ $Date: 2004/02/18 01:15:42 $
|
||||
* @version $Revision: 1.45 $ $Date: 2004/04/01 20:12:00 $
|
||||
*
|
||||
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
||||
* @author <a href="mailto:nissim@nksystems.com">Nissim Karpenstein</a>
|
||||
@ -1138,10 +1138,13 @@ public class MapUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a predicated map backed by the given map. Only keys and
|
||||
* values that pass the given predicates can be added to the map.
|
||||
* It is important not to use the original map after invoking this
|
||||
* method, as it is a backdoor for adding unvalidated objects.
|
||||
* Returns a predicated (validating) map backed by the given map.
|
||||
* <p>
|
||||
* Only objects that pass the tests in the given predicates can be added to the map.
|
||||
* Trying to add an invalid object results in an IllegalArgumentException.
|
||||
* Keys must pass the key predicate, values must pass the value predicate.
|
||||
* It is important not to use the original map after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param map the map to predicate, must not be null
|
||||
* @param keyPred the predicate for keys, null means no check
|
||||
@ -1328,10 +1331,13 @@ public class MapUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a predicated sorted map backed by the given map. Only keys and
|
||||
* values that pass the given predicates can be added to the map.
|
||||
* It is important not to use the original map after invoking this
|
||||
* method, as it is a backdoor for adding unvalidated objects.
|
||||
* Returns a predicated (validating) sorted map backed by the given map.
|
||||
* <p>
|
||||
* Only objects that pass the tests in the given predicates can be added to the map.
|
||||
* Trying to add an invalid object results in an IllegalArgumentException.
|
||||
* Keys must pass the key predicate, values must pass the value predicate.
|
||||
* It is important not to use the original map after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param map the map to predicate, must not be null
|
||||
* @param keyPred the predicate for keys, null means no check
|
||||
|
@ -39,7 +39,7 @@ import org.apache.commons.collections.set.UnmodifiableSortedSet;
|
||||
* {@link Set} and {@link SortedSet} instances.
|
||||
*
|
||||
* @since Commons Collections 2.1
|
||||
* @version $Revision: 1.25 $ $Date: 2004/02/18 01:15:42 $
|
||||
* @version $Revision: 1.26 $ $Date: 2004/04/01 20:12:00 $
|
||||
*
|
||||
* @author Paul Jack
|
||||
* @author Stephen Colebourne
|
||||
@ -176,10 +176,12 @@ public class SetUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a predicated set backed by the given set. Only objects
|
||||
* that pass the test in the given predicate can be added to the set.
|
||||
* It is important not to use the original set after invoking this
|
||||
* method, as it is a backdoor for adding unvalidated objects.
|
||||
* Returns a predicated (validating) set backed by the given set.
|
||||
* <p>
|
||||
* Only objects that pass the test in the given predicate can be added to the set.
|
||||
* Trying to add an invalid object results in an IllegalArgumentException.
|
||||
* It is important not to use the original set after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param set the set to predicate, must not be null
|
||||
* @param predicate the predicate for the set, must not be null
|
||||
@ -275,11 +277,12 @@ public class SetUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a predicated sorted set backed by the given sorted set.
|
||||
* Only objects that pass the test in the given predicate can be added
|
||||
* to the sorted set.
|
||||
* It is important not to use the original sorted set after invoking this
|
||||
* method, as it is a backdoor for adding unvalidated objects.
|
||||
* Returns a predicated (validating) sorted set backed by the given sorted set.
|
||||
* <p>
|
||||
* Only objects that pass the test in the given predicate can be added to the set.
|
||||
* Trying to add an invalid object results in an IllegalArgumentException.
|
||||
* It is important not to use the original set after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param set the sorted set to predicate, must not be null
|
||||
* @param predicate the predicate for the sorted set, must not be null
|
||||
|
Loading…
x
Reference in New Issue
Block a user