Keel 2.1RC2

org.apache.commons.collections
Class SetUtils

java.lang.Object
  extended byorg.apache.commons.collections.SetUtils

public class SetUtils
extends java.lang.Object

Provides static utility methods and decorators for SetUtils.PredicatedSet and SortedSet instances.

Since:
2.1
Version:
$Id: SetUtils.java,v 1.7 2002/10/13 00:38:36 scolebourne Exp $
Author:
Paul Jack, Stephen Colebourne

Nested Class Summary
(package private) static class SetUtils.PredicatedSet
           
(package private) static class SetUtils.PredicatedSortedSet
           
 
Constructor Summary
private SetUtils()
          Prevents instantiation.
 
Method Summary
static java.util.Set predicatedSet(java.util.Set set, Predicate predicate)
          Returns a predicated set backed by the given set.
static java.util.SortedSet predicatedSortedSet(java.util.SortedSet set, Predicate predicate)
          Returns a predicated sorted set backed by the given sorted set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetUtils

private SetUtils()
Prevents instantiation.

Method Detail

predicatedSet

public static java.util.Set predicatedSet(java.util.Set set,
                                          Predicate predicate)
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.

Parameters:
set - the set to predicate, must not be null
predicate - the predicate for the set, must not be null
Returns:
a predicated set backed by the given set
Throws:
java.lang.IllegalArgumentException - if the Set or Predicate is null

predicatedSortedSet

public static java.util.SortedSet predicatedSortedSet(java.util.SortedSet set,
                                                      Predicate predicate)
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.

Parameters:
set - the sorted set to predicate, must not be null
predicate - the predicate for the sorted set, must not be null
Returns:
a predicated sorted set backed by the given sorted set
Throws:
java.lang.IllegalArgumentException - if the Set or Predicate is null

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.