net.m2technologies.open_arm.utilities.collections
Class CollectionUtils

java.lang.Object
  extended byorg.apache.commons.collections.CollectionUtils
      extended bynet.m2technologies.open_arm.utilities.collections.CollectionUtils

public class CollectionUtils
extends org.apache.commons.collections.CollectionUtils

Copyright 2005 Mark Masterson

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Description: Erweiterungen zu den Collection-Utilites von Jacarta

Version:
0.009
Author:
Peter Koßek
See Also:
Serialized Form

Constructor Summary
CollectionUtils()
           
 
Method Summary
static java.util.Collection collectAndSelect(java.util.Collection inputCollection, Transformer transformer, Predicate predicate)
          Collects all elements from inputCollection with the given transformer and selects the transformed elements which match the given predicate to outputCollection.
static void collectAndSelect(java.util.Collection inputCollection, Transformer transformer, Predicate predicate, java.util.Collection outputCollection)
          Collects all elements from inputCollection with the given transformer and selects the transformed elements which match the given predicate to outputCollection.
static boolean exists(java.util.Collection collection, Predicate predicate)
          Answers true if a predicate is true for at least one element of a collection
static boolean forAll(java.util.Collection inputCollection, Predicate predicate)
          Answers true if a predicate is true for all elements of a collection
static java.util.Collection selectAndCollect(java.util.Collection inputCollection, Predicate predicate, Transformer transformer)
          Selects all elements from inputCollection which match the given predicate and adds the transformation of the selected elements to outputCollection.
static void selectAndCollect(java.util.Collection inputCollection, Predicate predicate, Transformer transformer, java.util.Collection outputCollection)
          Selects all elements from inputCollection which match the given predicate and adds the transformation of the selected elements to outputCollection.
static java.util.Collection selectRejected(java.util.Collection inputCollection, Predicate predicate)
          Selects all elements from inputCollection which don't match the given predicate into an output collection.
static void selectRejected(java.util.Collection inputCollection, Predicate predicate, java.util.Collection outputCollection)
          Selects all elements from inputCollection which don't match the given predicate and adds them to outputCollection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionUtils

public CollectionUtils()
Method Detail

exists

public static boolean exists(java.util.Collection collection,
                             Predicate predicate)
Answers true if a predicate is true for at least one element of a collection

Returns:
whether at least one element of the collection matches the predicate or false if none could be found

forAll

public static boolean forAll(java.util.Collection inputCollection,
                             Predicate predicate)
Answers true if a predicate is true for all elements of a collection

Returns:
whether each element of the collection matches the predicate or false if one element doesn't match

selectRejected

public static java.util.Collection selectRejected(java.util.Collection inputCollection,
                                                  Predicate predicate)
Selects all elements from inputCollection which don't match the given predicate into an output collection.


selectRejected

public static void selectRejected(java.util.Collection inputCollection,
                                  Predicate predicate,
                                  java.util.Collection outputCollection)
Selects all elements from inputCollection which don't match the given predicate and adds them to outputCollection.


selectAndCollect

public static java.util.Collection selectAndCollect(java.util.Collection inputCollection,
                                                    Predicate predicate,
                                                    Transformer transformer)
Selects all elements from inputCollection which match the given predicate and adds the transformation of the selected elements to outputCollection.


selectAndCollect

public static void selectAndCollect(java.util.Collection inputCollection,
                                    Predicate predicate,
                                    Transformer transformer,
                                    java.util.Collection outputCollection)
Selects all elements from inputCollection which match the given predicate and adds the transformation of the selected elements to outputCollection.


collectAndSelect

public static java.util.Collection collectAndSelect(java.util.Collection inputCollection,
                                                    Transformer transformer,
                                                    Predicate predicate)
Collects all elements from inputCollection with the given transformer and selects the transformed elements which match the given predicate to outputCollection.


collectAndSelect

public static void collectAndSelect(java.util.Collection inputCollection,
                                    Transformer transformer,
                                    Predicate predicate,
                                    java.util.Collection outputCollection)
Collects all elements from inputCollection with the given transformer and selects the transformed elements which match the given predicate to outputCollection.