Example usage for Java org.apache.commons.collections CollectionUtils fields, constructors, methods, implement or subclass
The text is from its open source code.
Collection | EMPTY_COLLECTION An empty unmodifiable collection. |
CollectionUtils()CollectionUtils should not normally be instantiated. |
void | addAll(Collection collection, Iterator iterator) Adds all elements in the iteration to the given collection. |
void | addAll(Collection collection, Enumeration enumeration) Adds all elements in the enumeration to the given collection. |
void | addAll(Collection collection, Object[] elements) Adds all elements in the array to the given collection. |
boolean | addIgnoreNull(Collection collection, Object object) Adds an element to the collection unless the element is null. |
int | cardinality(Object obj, final Collection coll) Returns the number of occurrences of obj in coll. |
Collection | collect(Collection inputCollection, Transformer transformer) Returns a new Collection consisting of the elements of inputCollection transformed by the given transformer. |
Collection | collect(Iterator inputIterator, Transformer transformer) Transforms all elements from the inputIterator with the given transformer and adds them to the outputCollection. |
Collection | collect(Collection inputCollection, final Transformer transformer, final Collection outputCollection) Transforms all elements from inputCollection with the given transformer and adds them to the outputCollection. |
Collection | collect(Iterator inputIterator, final Transformer transformer, final Collection outputCollection) Transforms all elements from the inputIterator with the given transformer and adds them to the outputCollection. |
boolean | containsAny(final Collection coll1, final Collection coll2) Returns true iff at least one element is in both collections. |
int | countMatches(Collection inputCollection, Predicate predicate) Counts the number of elements in the input collection that match the predicate. |
Collection | disjunction(final Collection a, final Collection b) Returns a Collection containing the exclusive disjunction (symmetric difference) of the given Collection s. |
boolean | exists(Collection collection, Predicate predicate) Answers true if a predicate is true for at least one element of a collection. |
void | filter(Collection collection, Predicate predicate) Filter the collection by applying a Predicate to each element. |
Object | find(Collection collection, Predicate predicate) Finds the first element in the given collection which matches the given predicate. |
void | forAllDo(Collection collection, Closure closure) Executes the given closure on each element in the collection. |
Object | get(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. |
Map | getCardinalityMap(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 . |
Collection | intersection(final Collection a, final Collection b) Returns a Collection containing the intersection of the given Collection s. |
boolean | isEqualCollection(final Collection a, final Collection b) Returns true iff the given Collection s contain exactly the same elements with exactly the same cardinalities. |
boolean | isSubCollection(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. |
Collection | predicatedCollection(Collection collection, Predicate predicate) Returns a predicated (validating) collection backed by the given collection. |
Collection | removeAll(Collection collection, Collection remove) Removes the elements in remove from collection . |
Collection | retainAll(Collection collection, Collection retain) Returns a collection containing all the elements in collection that are also in retain . |
void | reverseArray(Object[] array) Reverses the order of the given array. |
Collection | select(Collection inputCollection, Predicate predicate) Selects all elements from input collection which match the given predicate into an output collection. |
void | select(Collection inputCollection, Predicate predicate, Collection outputCollection) Selects all elements from input collection which match the given predicate and adds them to outputCollection. |
Collection | selectRejected(Collection inputCollection, Predicate predicate) Selects all elements from inputCollection which don't match the given predicate into an output collection. |
void | selectRejected(Collection inputCollection, Predicate predicate, Collection outputCollection) Selects all elements from inputCollection which don't match the given predicate and adds them to outputCollection. |
int | size(Object object) Gets the size of the collection/iterator specified. |
Collection | subtract(final Collection a, final Collection b) Returns a new Collection containing a - b. |
void | transform(Collection collection, Transformer transformer) Transform the collection by applying a Transformer to each element. |
Collection | transformedCollection(Collection collection, Transformer transformer) Returns a transformed bag backed by the given collection. |
Collection | typedCollection(Collection collection, Class type) Returns a typed collection backed by the given collection. |
Collection | union(final Collection a, final Collection b) Returns a Collection containing the union of the given Collection s. |
Collection | unmodifiableCollection(Collection collection) Returns an unmodifiable collection backed by the given collection. |