Change to InstanceofPredicate to avoid indirect references via PredicateUtils

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131706 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2004-05-07 23:28:38 +00:00
parent 9f99282555
commit 28ff2455d8
7 changed files with 21 additions and 21 deletions

View File

@ -16,7 +16,7 @@
package org.apache.commons.collections.bag;
import org.apache.commons.collections.Bag;
import org.apache.commons.collections.PredicateUtils;
import org.apache.commons.collections.functors.InstanceofPredicate;
/**
* Decorates another <code>Bag</code> to validate that elements added
@ -27,7 +27,7 @@ import org.apache.commons.collections.PredicateUtils;
* collection, an IllegalArgumentException is thrown.
*
* @since Commons Collections 3.0
* @version $Revision: 1.4 $ $Date: 2004/02/18 00:56:25 $
* @version $Revision: 1.5 $ $Date: 2004/05/07 23:28:38 $
*
* @author Stephen Colebourne
* @author Matthew Hawthorne
@ -46,7 +46,7 @@ public class TypedBag {
* @throws IllegalArgumentException if the bag contains invalid elements
*/
public static Bag decorate(Bag bag, Class type) {
return new PredicatedBag(bag, PredicateUtils.instanceofPredicate(type));
return new PredicatedBag(bag, InstanceofPredicate.getInstance(type));
}
/**

View File

@ -15,8 +15,8 @@
*/
package org.apache.commons.collections.bag;
import org.apache.commons.collections.PredicateUtils;
import org.apache.commons.collections.SortedBag;
import org.apache.commons.collections.functors.InstanceofPredicate;
/**
* Decorates another <code>SortedBag</code> to validate that elements added
@ -27,7 +27,7 @@ import org.apache.commons.collections.SortedBag;
* collection, an IllegalArgumentException is thrown.
*
* @since Commons Collections 3.0
* @version $Revision: 1.4 $ $Date: 2004/02/18 00:56:25 $
* @version $Revision: 1.5 $ $Date: 2004/05/07 23:28:38 $
*
* @author Stephen Colebourne
* @author Matthew Hawthorne
@ -46,7 +46,7 @@ public class TypedSortedBag {
* @throws IllegalArgumentException if the bag contains invalid elements
*/
public static SortedBag decorate(SortedBag bag, Class type) {
return new PredicatedSortedBag(bag, PredicateUtils.instanceofPredicate(type));
return new PredicatedSortedBag(bag, InstanceofPredicate.getInstance(type));
}
/**

View File

@ -16,7 +16,7 @@
package org.apache.commons.collections.buffer;
import org.apache.commons.collections.Buffer;
import org.apache.commons.collections.PredicateUtils;
import org.apache.commons.collections.functors.InstanceofPredicate;
/**
* Decorates another <code>Buffer</code> to validate that elements added
@ -27,7 +27,7 @@ import org.apache.commons.collections.PredicateUtils;
* collection, an IllegalArgumentException is thrown.
*
* @since Commons Collections 3.0
* @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:18 $
* @version $Revision: 1.4 $ $Date: 2004/05/07 23:28:38 $
*
* @author Stephen Colebourne
* @author Matthew Hawthorne
@ -46,7 +46,7 @@ public class TypedBuffer {
* @throws IllegalArgumentException if the buffer contains invalid elements
*/
public static Buffer decorate(Buffer buffer, Class type) {
return new PredicatedBuffer(buffer, PredicateUtils.instanceofPredicate(type));
return new PredicatedBuffer(buffer, InstanceofPredicate.getInstance(type));
}
/**

View File

@ -17,7 +17,7 @@ package org.apache.commons.collections.collection;
import java.util.Collection;
import org.apache.commons.collections.PredicateUtils;
import org.apache.commons.collections.functors.InstanceofPredicate;
/**
* Decorates a <code>Collection</code> to validate that elements added are of a specific type.
@ -27,7 +27,7 @@ import org.apache.commons.collections.PredicateUtils;
* collection, an IllegalArgumentException is thrown.
*
* @since Commons Collections 3.0
* @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:53 $
* @version $Revision: 1.4 $ $Date: 2004/05/07 23:28:38 $
*
* @author Stephen Colebourne
* @author Matthew Hawthorne
@ -46,7 +46,7 @@ public class TypedCollection {
* @throws IllegalArgumentException if the collection contains invalid elements
*/
public static Collection decorate(Collection coll, Class type) {
return new PredicatedCollection(coll, PredicateUtils.instanceofPredicate(type));
return new PredicatedCollection(coll, InstanceofPredicate.getInstance(type));
}
/**

View File

@ -17,7 +17,7 @@ package org.apache.commons.collections.list;
import java.util.List;
import org.apache.commons.collections.PredicateUtils;
import org.apache.commons.collections.functors.InstanceofPredicate;
/**
* Decorates another <code>List</code> to validate that elements
@ -28,7 +28,7 @@ import org.apache.commons.collections.PredicateUtils;
* collection, an IllegalArgumentException is thrown.
*
* @since Commons Collections 3.0
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:12:26 $
* @version $Revision: 1.4 $ $Date: 2004/05/07 23:28:38 $
*
* @author Stephen Colebourne
* @author Matthew Hawthorne
@ -47,7 +47,7 @@ public class TypedList {
* @throws IllegalArgumentException if the list contains invalid elements
*/
public static List decorate(List list, Class type) {
return new PredicatedList(list, PredicateUtils.instanceofPredicate(type));
return new PredicatedList(list, InstanceofPredicate.getInstance(type));
}
/**

View File

@ -17,7 +17,7 @@ package org.apache.commons.collections.set;
import java.util.Set;
import org.apache.commons.collections.PredicateUtils;
import org.apache.commons.collections.functors.InstanceofPredicate;
/**
* Decorates another <code>Set</code> to validate that elements
@ -28,7 +28,7 @@ import org.apache.commons.collections.PredicateUtils;
* collection, an IllegalArgumentException is thrown.
*
* @since Commons Collections 3.0
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:14:27 $
* @version $Revision: 1.4 $ $Date: 2004/05/07 23:28:38 $
*
* @author Stephen Colebourne
* @author Matthew Hawthorne
@ -47,7 +47,7 @@ public class TypedSet {
* @throws IllegalArgumentException if the set contains invalid elements
*/
public static Set decorate(Set set, Class type) {
return new PredicatedSet(set, PredicateUtils.instanceofPredicate(type));
return new PredicatedSet(set, InstanceofPredicate.getInstance(type));
}
/**

View File

@ -17,7 +17,7 @@ package org.apache.commons.collections.set;
import java.util.SortedSet;
import org.apache.commons.collections.PredicateUtils;
import org.apache.commons.collections.functors.InstanceofPredicate;
/**
* Decorates another <code>SortedSet</code> to validate that elements
@ -28,7 +28,7 @@ import org.apache.commons.collections.PredicateUtils;
* collection, an IllegalArgumentException is thrown.
*
* @since Commons Collections 3.0
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:14:27 $
* @version $Revision: 1.4 $ $Date: 2004/05/07 23:28:38 $
*
* @author Stephen Colebourne
* @author Matthew Hawthorne
@ -47,7 +47,7 @@ public class TypedSortedSet {
* @throws IllegalArgumentException if the set contains invalid elements
*/
public static SortedSet decorate(SortedSet set, Class type) {
return new PredicatedSortedSet(set, PredicateUtils.instanceofPredicate(type));
return new PredicatedSortedSet(set, InstanceofPredicate.getInstance(type));
}
/**