Java org.apache.commons.collections CollectionUtils fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.collections CollectionUtils fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.collections CollectionUtils.

The text is from its open source code.

Subclass

org.apache.commons.collections.CollectionUtils has subclasses.
Click this link to see all its subclasses.

Field

CollectionEMPTY_COLLECTION
An empty unmodifiable collection.

Constructor

CollectionUtils()
CollectionUtils should not normally be instantiated.

Method

voidaddAll(Collection collection, Iterator iterator)
Adds all elements in the iteration to the given collection.
voidaddAll(Collection collection, Enumeration enumeration)
Adds all elements in the enumeration to the given collection.
voidaddAll(Collection collection, Object[] elements)
Adds all elements in the array to the given collection.
booleanaddIgnoreNull(Collection collection, Object object)
Adds an element to the collection unless the element is null.
intcardinality(Object obj, final Collection coll)
Returns the number of occurrences of obj in coll.
Collectioncollect(Collection inputCollection, Transformer transformer)
Returns a new Collection consisting of the elements of inputCollection transformed by the given transformer.
Collectioncollect(Iterator inputIterator, Transformer transformer)
Transforms all elements from the inputIterator with the given transformer and adds them to the outputCollection.
Collectioncollect(Collection inputCollection, final Transformer transformer, final Collection outputCollection)
Transforms all elements from inputCollection with the given transformer and adds them to the outputCollection.
Collectioncollect(Iterator inputIterator, final Transformer transformer, final Collection outputCollection)
Transforms all elements from the inputIterator with the given transformer and adds them to the outputCollection.
booleancontainsAny(final Collection coll1, final Collection coll2)
Returns true iff at least one element is in both collections.
intcountMatches(Collection inputCollection, Predicate predicate)
Counts the number of elements in the input collection that match the predicate.
Collectiondisjunction(final Collection a, final Collection b)
Returns a Collection containing the exclusive disjunction (symmetric difference) of the given Collection s.
booleanexists(Collection collection, Predicate predicate)
Answers true if a predicate is true for at least one element of a collection.
voidfilter(Collection collection, Predicate predicate)
Filter the collection by applying a Predicate to each element.
Objectfind(Collection collection, Predicate predicate)
Finds the first element in the given collection which matches the given predicate.
voidforAllDo(Collection collection, Closure closure)
Executes the given closure on each element in the collection.
Objectget(Object object, int index)
Returns the index-th value in object, throwing IndexOutOfBoundsException if there is no such element or IllegalArgumentException if object is not an instance of one of the supported types.
MapgetCardinalityMap(final Collection coll)
Returns a Map mapping each unique element in the given Collection to an Integer representing the number of occurrences of that element in the Collection .
Collectionintersection(final Collection a, final Collection b)
Returns a Collection containing the intersection of the given Collection s.
booleanisEqualCollection(final Collection a, final Collection b)
Returns true iff the given Collection s contain exactly the same elements with exactly the same cardinalities.
booleanisSubCollection(final Collection a, final Collection b)
Returns true iff a is a sub-collection of b, that is, iff the cardinality of e in a is less than or equal to the cardinality of e in b, for each element e in a.
CollectionpredicatedCollection(Collection collection, Predicate predicate)
Returns a predicated (validating) collection backed by the given collection.
CollectionremoveAll(Collection collection, Collection remove)
Removes the elements in remove from collection.
CollectionretainAll(Collection collection, Collection retain)
Returns a collection containing all the elements in collection that are also in retain.
voidreverseArray(Object[] array)
Reverses the order of the given array.
Collectionselect(Collection inputCollection, Predicate predicate)
Selects all elements from input collection which match the given predicate into an output collection.
voidselect(Collection inputCollection, Predicate predicate, Collection outputCollection)
Selects all elements from input collection which match the given predicate and adds them to outputCollection.
CollectionselectRejected(Collection inputCollection, Predicate predicate)
Selects all elements from inputCollection which don't match the given predicate into an output collection.
voidselectRejected(Collection inputCollection, Predicate predicate, Collection outputCollection)
Selects all elements from inputCollection which don't match the given predicate and adds them to outputCollection.
intsize(Object object)
Gets the size of the collection/iterator specified.
Collectionsubtract(final Collection a, final Collection b)
Returns a new Collection containing a - b.
voidtransform(Collection collection, Transformer transformer)
Transform the collection by applying a Transformer to each element.
CollectiontransformedCollection(Collection collection, Transformer transformer)
Returns a transformed bag backed by the given collection.
CollectiontypedCollection(Collection collection, Class type)
Returns a typed collection backed by the given collection.
Collectionunion(final Collection a, final Collection b)
Returns a Collection containing the union of the given Collection s.
CollectionunmodifiableCollection(Collection collection)
Returns an unmodifiable collection backed by the given collection.