mirror of
https://github.com/apache/commons-collections.git
synced 2025-02-08 11:05:46 +00:00
Close tags in class-level Javadoc. No empty p tags.
Remove trailing spaces.
This commit is contained in:
parent
0d489086a3
commit
b0b5759d5a
@ -30,11 +30,13 @@ import java.util.EmptyStackException;
|
||||
* order: The most recently added element is removed first. The iteration
|
||||
* order is <i>not</i> the same as the removal order. The iterator returns
|
||||
* elements from the bottom up.
|
||||
* </p>
|
||||
* <p>
|
||||
* Unlike <code>Stack</code>, <code>ArrayStack</code> accepts null entries.
|
||||
* <p>
|
||||
* <b>Note:</b> From version 4.0 onwards, this class does not implement the
|
||||
* removed {@code Buffer} interface anymore.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this list
|
||||
* @see java.util.Stack
|
||||
|
@ -39,6 +39,7 @@ import java.util.Set;
|
||||
* This violation resulted from the original specification of this interface.
|
||||
* In an ideal world, the interface would be changed to fix the problems, however
|
||||
* it has been decided to maintain backwards compatibility instead.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 2.0
|
||||
@ -146,7 +147,7 @@ public interface Bag<E> extends Collection<E> {
|
||||
* given collection <code>coll</code> contains <code>n</code> copies
|
||||
* of a given object, calling {@link #getCount(Object)} on that object must
|
||||
* be <code>>= n</code> for all <code>n</code> in <code>coll</code>.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* The {@link Collection#containsAll(Collection)} method specifies
|
||||
* that cardinality should <i>not</i> be respected; this method should
|
||||
|
@ -80,8 +80,8 @@ public interface BidiMap<K, V> extends IterableMap<K, V> {
|
||||
/**
|
||||
* Gets the key that is currently mapped to the specified value.
|
||||
* <p>
|
||||
* </p>
|
||||
* If the value is not contained in the map, <code>null</code> is returned.
|
||||
* </p>
|
||||
* <p>
|
||||
* Implementations should seek to make this method perform equally as well
|
||||
* as <code>get(Object)</code>.
|
||||
|
@ -24,6 +24,7 @@ import java.util.Collection;
|
||||
* The size of the collection can vary, but it can never exceed a preset
|
||||
* maximum number of elements. This interface allows the querying of details
|
||||
* associated with the maximum number of elements.
|
||||
* </p>
|
||||
*
|
||||
* @see CollectionUtils#isFull
|
||||
* @see CollectionUtils#maxSize
|
||||
|
@ -22,6 +22,7 @@ package org.apache.commons.collections4;
|
||||
* The size of the map can vary, but it can never exceed a preset
|
||||
* maximum number of elements. This interface allows the querying of details
|
||||
* associated with the maximum number of elements.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -21,9 +21,11 @@ package org.apache.commons.collections4;
|
||||
* <p>
|
||||
* A <code>Closure</code> represents a block of code which is executed from
|
||||
* inside some block, function or iteration. It operates an input object.
|
||||
* </p>
|
||||
* <p>
|
||||
* Standard implementations of common closures are provided by
|
||||
* {@link ClosureUtils}. These include method invocation and for/while loops.
|
||||
* </p>
|
||||
*
|
||||
* @param <T> the type that the closure acts on
|
||||
* @since 1.0
|
||||
|
@ -48,6 +48,7 @@ import org.apache.commons.collections4.functors.WhileClosure;
|
||||
* <p>
|
||||
* Since v4.1 only closures which are considered to be safe are
|
||||
* Serializable. Closures considered to be unsafe for serialization are:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>Invoker
|
||||
* <li>For
|
||||
|
@ -46,8 +46,10 @@ import org.apache.commons.collections4.iterators.PermutationIterator;
|
||||
* Various utility methods might put the input objects into a Set/Map/Bag. In case
|
||||
* the input objects override {@link Object#equals(Object)}, it is mandatory that
|
||||
* the general contract of the {@link Object#hashCode()} method is maintained.
|
||||
* </p>
|
||||
* <p>
|
||||
* NOTE: From 4.0, method parameters will take {@link Iterable} objects when possible.
|
||||
* </p>
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
|
@ -15,6 +15,7 @@ package org.apache.commons.collections4;
|
||||
* <p>
|
||||
* It is the functional sibling of {@link java.util.Comparator}; {@link Equator} is to
|
||||
* {@link Object} as {@link java.util.Comparator} is to {@link java.lang.Comparable}.
|
||||
* </p>
|
||||
*
|
||||
* @param <T> the types of object this {@link Equator} can evaluate.
|
||||
* @since 4.0
|
||||
|
@ -21,10 +21,12 @@ package org.apache.commons.collections4;
|
||||
* <p>
|
||||
* A <code>Factory</code> creates an object without using an input parameter.
|
||||
* If an input parameter is required, then {@link Transformer} is more appropriate.
|
||||
* </p>
|
||||
* <p>
|
||||
* Standard implementations of common factories are provided by
|
||||
* {@link FactoryUtils}. These include factories that return a constant,
|
||||
* a copy of a prototype or a new instance.
|
||||
* </p>
|
||||
*
|
||||
* @param <T> the type that the factory creates
|
||||
*
|
||||
|
@ -31,6 +31,7 @@ import org.apache.commons.collections4.iterators.SingletonIterator;
|
||||
* <p>
|
||||
* A FluentIterable can be created either from an Iterable or from a set
|
||||
* of elements. The following types of methods are provided:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>fluent methods which return a new {@code FluentIterable} instance,
|
||||
* providing a view of the original iterable (e.g. filter(Predicate));
|
||||
@ -43,6 +44,7 @@ import org.apache.commons.collections4.iterators.SingletonIterator;
|
||||
* <p>
|
||||
* The following example outputs the first 3 even numbers in the range [1, 10]
|
||||
* into a list:
|
||||
* </p>
|
||||
* <pre>
|
||||
* List<String> result =
|
||||
* FluentIterable
|
||||
|
@ -23,6 +23,7 @@ import java.util.Map;
|
||||
* <p>
|
||||
* A map iterator is an efficient way of iterating over maps.
|
||||
* There is no need to access the entry set or use Map Entry objects.
|
||||
* </p>
|
||||
* <pre>
|
||||
* IterableMap<String,Integer> map = new HashedMap<String,Integer>();
|
||||
* MapIterator<String,Integer> it = map.mapIterator();
|
||||
|
@ -33,6 +33,7 @@ import org.apache.commons.collections4.iterators.UniqueFilterIterator;
|
||||
* Provides utility methods and decorators for {@link Iterable} instances.
|
||||
* <p>
|
||||
* <b>Note</b>: this util class has been designed for fail-fast argument checking.
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* all decorator methods are <b>NOT</b> null-safe wrt the provided Iterable argument, i.e.
|
||||
|
@ -22,6 +22,7 @@ package org.apache.commons.collections4;
|
||||
* A Map Entry has considerable additional semantics over and above a simple
|
||||
* key-value pair. This interface defines the minimum key value, with just the
|
||||
* two get methods.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the key
|
||||
* @param <V> the type of the value
|
||||
|
@ -22,6 +22,7 @@ import java.util.List;
|
||||
* Defines a map that holds a list of values against each key.
|
||||
* <p>
|
||||
* A {@code ListValuedMap} is a Map with slightly different semantics:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>Putting a value into the map will add the value to a {@link List} at that key.</li>
|
||||
* <li>Getting a value will return a {@link List}, holding all the values put to that key.</li>
|
||||
|
@ -24,13 +24,16 @@ import java.util.Iterator;
|
||||
* This iterator is a special version designed for maps. It can be more
|
||||
* efficient to use this rather than an entry set iterator where the option
|
||||
* is available, and it is certainly more convenient.
|
||||
* </p>
|
||||
* <p>
|
||||
* A map that provides this interface may not hold the data internally using
|
||||
* Map Entry objects, thus this interface can avoid lots of object creation.
|
||||
* </p>
|
||||
* <p>
|
||||
* In use, this iterator iterates through the keys in the map. After each call
|
||||
* to <code>next()</code>, the <code>getValue()</code> method provides direct
|
||||
* access to the value. The value can also be set using <code>setValue()</code>.
|
||||
* </p>
|
||||
* <pre>{@code
|
||||
* MapIterator<String,Integer> it = map.mapIterator();
|
||||
* while (it.hasNext()) {
|
||||
|
@ -54,8 +54,10 @@ import org.apache.commons.collections4.map.UnmodifiableSortedMap;
|
||||
* <p>
|
||||
* It contains various type safe methods
|
||||
* as well as other useful features like deep copying.
|
||||
* </p>
|
||||
* <p>
|
||||
* It also provides the following decorators:
|
||||
* </p>
|
||||
*
|
||||
* <ul>
|
||||
* <li>{@link #fixedSizeMap(Map)}
|
||||
|
@ -24,8 +24,10 @@ import java.util.Collection;
|
||||
* A <code>MultiMap</code> is a Map with slightly different semantics.
|
||||
* Putting a value into the map will add the value to a Collection at that key.
|
||||
* Getting a value will return a Collection, holding all the values put to that key.
|
||||
* </p>
|
||||
* <p>
|
||||
* For example:
|
||||
* </p>
|
||||
* <pre>
|
||||
* MultiMap mhm = new MultiValueMap();
|
||||
* mhm.put(key, "A");
|
||||
@ -34,10 +36,12 @@ import java.util.Collection;
|
||||
* Collection coll = (Collection) mhm.get(key);</pre>
|
||||
* <p>
|
||||
* <code>coll</code> will be a collection containing "A", "B", "C".
|
||||
* </p>
|
||||
* <p>
|
||||
* NOTE: Additional methods were added to this interface in Commons Collections 3.1.
|
||||
* These were added solely for documentation purposes and do not change the interface
|
||||
* as they were defined in the superinterface <code>Map</code> anyway.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -33,6 +33,7 @@ import org.apache.commons.collections4.multimap.UnmodifiableMultiValuedMap;
|
||||
* <p>
|
||||
* It contains various type safe and null safe methods. Additionally, it provides
|
||||
* the following decorators:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link #unmodifiableMultiValuedMap(MultiValuedMap)}</li>
|
||||
* <li>{@link #transformedMultiValuedMap(MultiValuedMap, Transformer, Transformer)}</li>
|
||||
|
@ -27,6 +27,7 @@ import java.util.Set;
|
||||
* Suppose you have a MultiSet that contains <code>{a, a, b, c}</code>.
|
||||
* Calling {@link #getCount(Object)} on <code>a</code> would return 2, while
|
||||
* calling {@link #uniqueSet()} would return <code>{a, b, c}</code>.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type held in the multiset
|
||||
* @since 4.1
|
||||
|
@ -25,12 +25,14 @@ import java.util.Set;
|
||||
* Defines a map that holds a collection of values against each key.
|
||||
* <p>
|
||||
* A {@code MultiValuedMap} is a Map with slightly different semantics:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>Putting a value into the map will add the value to a {@link Collection} at that key.</li>
|
||||
* <li>Getting a value will return a {@link Collection}, holding all the values put to that key.</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* For example:
|
||||
* </p>
|
||||
* <pre>
|
||||
* MultiValuedMap<K, String> map = new MultiValuedHashMap<K, String>();
|
||||
* map.put(key, "A");
|
||||
@ -40,7 +42,7 @@ import java.util.Set;
|
||||
* </pre>
|
||||
* <p>
|
||||
* <code>coll</code> will be a collection containing "A", "B", "C".
|
||||
* <p>
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -22,6 +22,7 @@ package org.apache.commons.collections4;
|
||||
* <p>
|
||||
* Implementations should allow a value to be looked up from a key and
|
||||
* a key to be looked up from a value with equal performance.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in the map
|
||||
* @param <V> the type of the values in the map
|
||||
|
@ -22,6 +22,7 @@ import java.util.Iterator;
|
||||
* Defines an iterator that operates over an ordered container. Subset of {@link java.util.ListIterator}.
|
||||
* <p>
|
||||
* This iterator allows both forward and reverse iteration through the container.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type to iterate over
|
||||
* @since 3.0
|
||||
|
@ -20,6 +20,7 @@ package org.apache.commons.collections4;
|
||||
* Defines an iterator that operates over an ordered <code>Map</code>.
|
||||
* <p>
|
||||
* This iterator allows both forward and reverse iteration through the map.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in the map
|
||||
* @param <V> the type of the values in the map
|
||||
|
@ -23,10 +23,12 @@ package org.apache.commons.collections4;
|
||||
* A <code>Predicate</code> is the object equivalent of an <code>if</code> statement.
|
||||
* It uses the input object to return a true or false value, and is often used in
|
||||
* validation or filtering.
|
||||
* </p>
|
||||
* <p>
|
||||
* Standard implementations of common predicates are provided by
|
||||
* {@link PredicateUtils}. These include true, false, instanceof, equals, and,
|
||||
* or, not, method invokation and null testing.
|
||||
* </p>
|
||||
*
|
||||
* @param <T> the type that the predicate queries
|
||||
*
|
||||
|
@ -26,6 +26,7 @@ import java.util.Map;
|
||||
* makes no assumptions in this regard (there is no association with, nor even knowledge
|
||||
* of, a "reading" interface) and thus defines {@link #put(Object, Object)} as returning
|
||||
* {@link Object}.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -22,6 +22,7 @@ import java.util.Iterator;
|
||||
* Defines an iterator that can be reset back to an initial state.
|
||||
* <p>
|
||||
* This interface allows an iterator to be repeatedly reused.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type to iterate over
|
||||
* @since 3.0
|
||||
|
@ -22,6 +22,7 @@ import java.util.ListIterator;
|
||||
* Defines a list iterator that can be reset back to an initial state.
|
||||
* <p>
|
||||
* This interface allows an iterator to be repeatedly reused.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type to iterate over
|
||||
* @since 3.0
|
||||
|
@ -22,6 +22,7 @@ import java.util.Set;
|
||||
* Defines a map that holds a set of values against each key.
|
||||
* <p>
|
||||
* A {@code SetValuedMap} is a Map with slightly different semantics:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>Putting a value into the map will add the value to a {@link Set} at that key.</li>
|
||||
* <li>Getting a value will return a {@link Set}, holding all the values put to that key.</li>
|
||||
|
@ -25,6 +25,7 @@ import java.util.SortedMap;
|
||||
* <p>
|
||||
* Implementations should allow a value to be looked up from a key and
|
||||
* a key to be looked up from a value with equal performance.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in the map
|
||||
* @param <V> the type of the values in the map
|
||||
|
@ -24,10 +24,12 @@ package org.apache.commons.collections4;
|
||||
* The input object should be left unchanged.
|
||||
* Transformers are typically used for type conversions, or extracting data
|
||||
* from an object.
|
||||
* </p>
|
||||
* <p>
|
||||
* Standard implementations of common transformers are provided by
|
||||
* {@link TransformerUtils}. These include method invocation, returning a constant,
|
||||
* cloning and returning the string value.
|
||||
* </p>
|
||||
*
|
||||
* @param <I> the input type to the transformer
|
||||
* @param <O> the output type from the transformer
|
||||
|
@ -59,6 +59,7 @@ import org.apache.commons.collections4.functors.SwitchTransformer;
|
||||
* <p>
|
||||
* Since v4.1 only transformers which are considered to be safe are
|
||||
* Serializable. Transformers considered to be unsafe for serialization are:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>Invoker
|
||||
* <li>Clone
|
||||
|
@ -20,6 +20,7 @@ package org.apache.commons.collections4;
|
||||
* Marker interface for collections, maps and iterators that are unmodifiable.
|
||||
* <p>
|
||||
* This interface enables testing such as:
|
||||
* </p>
|
||||
* <pre>
|
||||
* if (coll instanceof Unmodifiable) {
|
||||
* coll = new ArrayList(coll);
|
||||
|
@ -25,6 +25,7 @@ import org.apache.commons.collections4.collection.AbstractCollectionDecorator;
|
||||
* Decorates another <code>Bag</code> to provide additional behaviour.
|
||||
* <p>
|
||||
* Methods are forwarded directly to the decorated bag.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0
|
||||
|
@ -37,6 +37,7 @@ import org.apache.commons.collections4.set.UnmodifiableSet;
|
||||
* Subclasses specify a Map implementation to use as the internal storage. The
|
||||
* map will be used to map bag elements to a number; the number represents the
|
||||
* number of occurrences of that element in the bag.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0 (previously DefaultMapBag v2.0)
|
||||
|
@ -24,6 +24,7 @@ import org.apache.commons.collections4.SortedBag;
|
||||
* Decorates another <code>SortedBag</code> to provide additional behaviour.
|
||||
* <p>
|
||||
* Methods are forwarded directly to the decorated bag.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0
|
||||
|
@ -30,8 +30,10 @@ import org.apache.commons.collections4.Bag;
|
||||
* By decorating an existing {@link Bag} instance with a {@link CollectionBag},
|
||||
* it can be safely passed on to methods that require Collection types that
|
||||
* are fully compliant with the Collection contract.
|
||||
* </p>
|
||||
* <p>
|
||||
* The method javadoc highlights the differences compared to the original Bag interface.
|
||||
* </p>
|
||||
*
|
||||
* @see Bag
|
||||
* @param <E> the type of elements in this bag
|
||||
|
@ -32,6 +32,7 @@ import java.util.HashMap;
|
||||
* of an object to be added or removed at once. It is important to read the
|
||||
* interface javadoc carefully as several methods violate the
|
||||
* {@link Collection} interface specification.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0 (previously in main package v2.0)
|
||||
|
@ -29,13 +29,16 @@ import org.apache.commons.collections4.collection.PredicatedCollection;
|
||||
* This bag exists to provide validation for the decorated bag.
|
||||
* It is normally created to decorate an empty bag.
|
||||
* If an object cannot be added to the bag, an {@link IllegalArgumentException} is thrown.
|
||||
* </p>
|
||||
* <p>
|
||||
* One usage would be to ensure that no null entries are added to the bag.
|
||||
* </p>
|
||||
* <pre>
|
||||
* Bag bag = PredicatedBag.predicatedBag(new HashBag(), NotNullPredicate.INSTANCE);
|
||||
* </pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0
|
||||
|
@ -28,6 +28,7 @@ import org.apache.commons.collections4.SortedBag;
|
||||
* This bag exists to provide validation for the decorated bag.
|
||||
* It is normally created to decorate an empty bag.
|
||||
* If an object cannot be added to the bag, an {@link IllegalArgumentException} is thrown.
|
||||
* </p>
|
||||
* <p>
|
||||
* One usage would be to ensure that no null entries are added to the bag.
|
||||
* <pre>
|
||||
@ -35,6 +36,7 @@ import org.apache.commons.collections4.SortedBag;
|
||||
* </pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0
|
||||
|
@ -27,8 +27,10 @@ import org.apache.commons.collections4.collection.SynchronizedCollection;
|
||||
* <p>
|
||||
* Methods are synchronized, then forwarded to the decorated bag.
|
||||
* Iterators must be separately synchronized around the loop.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0
|
||||
|
@ -27,8 +27,10 @@ import org.apache.commons.collections4.SortedBag;
|
||||
* <p>
|
||||
* Methods are synchronized, then forwarded to the decorated bag.
|
||||
* Iterators must be separately synchronized around the loop.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0
|
||||
|
@ -30,8 +30,10 @@ import org.apache.commons.collections4.set.TransformedSet;
|
||||
* Thus objects must be removed or searched for using their transformed form.
|
||||
* For example, if the transformation converts Strings to Integers, you must
|
||||
* use the Integer form to remove objects.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0
|
||||
|
@ -28,8 +28,10 @@ import org.apache.commons.collections4.Transformer;
|
||||
* Thus objects must be removed or searched for using their transformed form.
|
||||
* For example, if the transformation converts Strings to Integers, you must
|
||||
* use the Integer form to remove objects.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0
|
||||
|
@ -32,11 +32,13 @@ import org.apache.commons.collections4.SortedBag;
|
||||
* This is the standard implementation of a sorted bag.
|
||||
* <p>
|
||||
* Order will be maintained among the bag members and can be viewed through the iterator.
|
||||
* </p>
|
||||
* <p>
|
||||
* A {@link org.apache.commons.collections4.Bag Bag} stores each object in the collection
|
||||
* together with a count of occurrences. Extra methods on the interface allow multiple
|
||||
* copies of an object to be added or removed at once. It is important to read the interface
|
||||
* javadoc carefully as several methods violate the {@link Collection} interface specification.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0 (previously in main package v2.0)
|
||||
|
@ -33,8 +33,10 @@ import org.apache.commons.collections4.set.UnmodifiableSet;
|
||||
* Decorates another {@link Bag} to ensure it can't be altered.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
* <p>
|
||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0
|
||||
|
@ -33,8 +33,10 @@ import org.apache.commons.collections4.set.UnmodifiableSet;
|
||||
* Decorates another {@link SortedBag} to ensure it can't be altered.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
* <p>
|
||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this bag
|
||||
* @since 3.0
|
||||
|
@ -27,12 +27,14 @@ import org.apache.commons.collections4.map.AbstractMapDecorator;
|
||||
* to a BidiMap via decoration.
|
||||
* <p>
|
||||
* Methods are forwarded directly to the decorated map.
|
||||
* </p>
|
||||
* <p>
|
||||
* This implementation does not perform any special processing with the map views.
|
||||
* Instead it simply returns the set/collection from the wrapped map. This may be
|
||||
* undesirable, for example if you are trying to write a validating implementation
|
||||
* it would provide a loophole around the validation.
|
||||
* But, you might want that loophole, so this class is kept simple.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -35,6 +35,7 @@ import org.apache.commons.collections4.keyvalue.AbstractMapEntryDecorator;
|
||||
* <p>
|
||||
* An implementation can be written simply by implementing the
|
||||
* {@link #createBidiMap(Map, Map, BidiMap)} method.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in the map
|
||||
* @param <V> the type of the values in the map
|
||||
|
@ -24,12 +24,14 @@ import org.apache.commons.collections4.OrderedMapIterator;
|
||||
* to an OrderedBidiMap via decoration.
|
||||
* <p>
|
||||
* Methods are forwarded directly to the decorated map.
|
||||
* </p>
|
||||
* <p>
|
||||
* This implementation does not perform any special processing with the map views.
|
||||
* Instead it simply returns the inverse from the wrapped map. This may be
|
||||
* undesirable, for example if you are trying to write a validating implementation
|
||||
* it would provide a loophole around the validation.
|
||||
* But, you might want that loophole, so this class is kept simple.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -26,12 +26,14 @@ import org.apache.commons.collections4.SortedBidiMap;
|
||||
* to a SortedBidiMap via decoration.
|
||||
* <p>
|
||||
* Methods are forwarded directly to the decorated map.
|
||||
* </p>
|
||||
* <p>
|
||||
* This implementation does not perform any special processing with the map views.
|
||||
* Instead it simply returns the inverse from the wrapped map. This may be
|
||||
* undesirable, for example if you are trying to write a validating implementation
|
||||
* it would provide a loophole around the validation.
|
||||
* But, you might want that loophole, so this class is kept simple.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -32,9 +32,11 @@ import org.apache.commons.collections4.BidiMap;
|
||||
* This provides fast lookups at the expense of storing two sets of map entries.
|
||||
* Commons Collections would welcome the addition of a direct hash-based
|
||||
* implementation of the {@link BidiMap} interface.
|
||||
* </p>
|
||||
* <p>
|
||||
* NOTE: From Commons Collections 3.1, all subclasses will use {@link HashMap}
|
||||
* and the flawed <code>createMap</code> method is ignored.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in the map
|
||||
* @param <V> the type of the values in the map
|
||||
|
@ -30,6 +30,7 @@ import org.apache.commons.collections4.BidiMap;
|
||||
* <p>
|
||||
* Two <code>LinkedHashMap</code> instances are used in this class.
|
||||
* This provides fast lookups at the expense of storing two sets of map entries and two linked lists.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in the map
|
||||
* @param <V> the type of the values in the map
|
||||
|
@ -41,13 +41,16 @@ import org.apache.commons.collections4.map.AbstractSortedMapDecorator;
|
||||
* <p>
|
||||
* The setValue() method on iterators will succeed only if the new value being set is
|
||||
* not already in the bidimap.
|
||||
* </p>
|
||||
* <p>
|
||||
* When considering whether to use this class, the {@link TreeBidiMap} class should
|
||||
* also be considered. It implements the interface using a dedicated design, and does
|
||||
* not store each object twice, which can save on memory use.
|
||||
* </p>
|
||||
* <p>
|
||||
* NOTE: From Commons Collections 3.1, all subclasses will use {@link TreeMap}
|
||||
* and the flawed <code>createMap</code> method is ignored.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -45,10 +45,12 @@ import org.apache.commons.collections4.keyvalue.UnmodifiableMapEntry;
|
||||
* This class guarantees that the map will be in both ascending key order
|
||||
* and ascending value order, sorted according to the natural order for
|
||||
* the key's and value's classes.
|
||||
* </p>
|
||||
* <p>
|
||||
* This Map is intended for applications that need to be able to look
|
||||
* up a key-value pairing by either key or value, and need to do so
|
||||
* with equal efficiency.
|
||||
* </p>
|
||||
* <p>
|
||||
* While that goal could be accomplished by taking a pair of TreeMaps
|
||||
* and redirecting requests to the appropriate TreeMap (e.g.,
|
||||
@ -58,6 +60,7 @@ import org.apache.commons.collections4.keyvalue.UnmodifiableMapEntry;
|
||||
* If the data contained in the TreeMaps is large, the cost of redundant
|
||||
* storage becomes significant. The {@link DualTreeBidiMap} and
|
||||
* {@link DualHashBidiMap} implementations use this approach.
|
||||
* </p>
|
||||
* <p>
|
||||
* This solution keeps minimizes the data storage by holding data only once.
|
||||
* The red-black algorithm is based on {@link java.util.TreeMap}, but has been modified
|
||||
@ -67,10 +70,12 @@ import org.apache.commons.collections4.keyvalue.UnmodifiableMapEntry;
|
||||
* node to be removed only has to be performed once). And since only one node
|
||||
* contains the key and value, storage is significantly less than that
|
||||
* required by two TreeMaps.
|
||||
* </p>
|
||||
* <p>
|
||||
* The Map.Entry instances returned by the appropriate methods will
|
||||
* not allow setValue() and will throw an
|
||||
* UnsupportedOperationException on attempts to call that method.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -30,6 +30,7 @@ import org.apache.commons.collections4.set.UnmodifiableSet;
|
||||
* Decorates another {@link BidiMap} to ensure it can't be altered.
|
||||
* <p>
|
||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -30,6 +30,7 @@ import org.apache.commons.collections4.set.UnmodifiableSet;
|
||||
* Decorates another {@link OrderedBidiMap} to ensure it can't be altered.
|
||||
* <p>
|
||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -32,6 +32,7 @@ import org.apache.commons.collections4.set.UnmodifiableSet;
|
||||
* Decorates another {@link SortedBidiMap} to ensure it can't be altered.
|
||||
* <p>
|
||||
* Attempts to modify it will result in an {@link UnsupportedOperationException}.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of the keys in this map
|
||||
* @param <V> the type of the values in this map
|
||||
|
@ -30,11 +30,13 @@ import java.util.function.Predicate;
|
||||
* main advantage of decoration is that one decorator can wrap any implementation
|
||||
* of <code>Collection</code>, whereas sub-classing requires a new class to be
|
||||
* written for each implementation.
|
||||
* </p>
|
||||
* <p>
|
||||
* This implementation does not perform any special processing with
|
||||
* {@link #iterator()}. Instead it simply returns the value from the
|
||||
* wrapped collection. This may be undesirable, for example if you are trying
|
||||
* to write an unmodifiable implementation it might provide a loophole.
|
||||
* </p>
|
||||
* <p>
|
||||
* This implementation does not forward the hashCode and equals methods through
|
||||
* to the backing object, but relies on Object's implementation. This is necessary
|
||||
@ -48,6 +50,7 @@ import java.util.function.Predicate;
|
||||
* JDK's collection wrappers, such as {@link java.util.Collections#unmodifiableCollection(Collection)}.
|
||||
* Use an interface-specific subclass of AbstractCollectionDecorator, such as
|
||||
* AbstractListDecorator, to preserve equality behavior, or override equals directly.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of the elements in the collection
|
||||
* @since 3.0
|
||||
|
@ -33,10 +33,12 @@ import org.apache.commons.collections4.map.MultiValueMap;
|
||||
* Modifications made to this decorator modify the index as well as the
|
||||
* decorated {@link Collection}. However, modifications to the underlying
|
||||
* {@link Collection} will not update the index and it will get out of sync.
|
||||
* </p>
|
||||
* <p>
|
||||
* If modification of the decorated {@link Collection} is unavoidable, then a
|
||||
* call to {@link #reindex()} will update the index to the current contents of
|
||||
* the {@link Collection}.
|
||||
* </p>
|
||||
*
|
||||
* @param <K> the type of object in the index.
|
||||
* @param <C> the type of object in the collection.
|
||||
|
@ -44,13 +44,16 @@ import org.apache.commons.collections4.set.PredicatedSet;
|
||||
* This collection exists to provide validation for the decorated collection.
|
||||
* It is normally created to decorate an empty collection.
|
||||
* If an object cannot be added to the collection, an IllegalArgumentException is thrown.
|
||||
* </p>
|
||||
* <p>
|
||||
* One usage would be to ensure that no null entries are added to the collection:
|
||||
* </p>
|
||||
* <pre>
|
||||
* Collection coll = PredicatedCollection.predicatedCollection(new ArrayList(), NotNullPredicate.INSTANCE);
|
||||
* </pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of the elements in the collection
|
||||
* @since 3.0
|
||||
|
@ -26,6 +26,7 @@ import java.util.function.Predicate;
|
||||
* for a multi-threaded environment.
|
||||
* <p>
|
||||
* Iterators must be manually synchronized:
|
||||
* </p>
|
||||
* <pre>
|
||||
* synchronized (coll) {
|
||||
* Iterator it = coll.iterator();
|
||||
@ -34,6 +35,7 @@ import java.util.function.Predicate;
|
||||
* </pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of the elements in the collection
|
||||
* @since 3.0
|
||||
|
@ -29,8 +29,10 @@ import org.apache.commons.collections4.Transformer;
|
||||
* Thus objects must be removed or searched for using their transformed form.
|
||||
* For example, if the transformation converts Strings to Integers, you must
|
||||
* use the Integer form to remove objects.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of the elements in the collection
|
||||
* @since 3.0
|
||||
|
@ -33,10 +33,13 @@ import org.apache.commons.collections4.iterators.UnmodifiableIterator;
|
||||
* longer accessible.
|
||||
* The factory on this class will attempt to retrieve the bounded nature by
|
||||
* examining the package scope variables.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
* <p>
|
||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this collection
|
||||
* @since 3.0
|
||||
|
@ -27,8 +27,10 @@ import org.apache.commons.collections4.iterators.UnmodifiableIterator;
|
||||
* Decorates another {@link Collection} to ensure it can't be altered.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
* <p>
|
||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of the elements in the collection
|
||||
* @since 3.0
|
||||
|
@ -22,7 +22,7 @@ import java.util.Comparator;
|
||||
/**
|
||||
* A {@link Comparator} for {@link Boolean} objects that can sort either
|
||||
* true or false first.
|
||||
* <p>
|
||||
*
|
||||
* @see #getTrueFirstComparator()
|
||||
* @see #getFalseFirstComparator()
|
||||
* @see #booleanComparator(boolean)
|
||||
|
@ -26,6 +26,7 @@ import java.util.Comparator;
|
||||
* This Comparator is useful, for example, for enforcing the natural order in
|
||||
* custom implementations of {@link java.util.SortedSet SortedSet} and
|
||||
* {@link java.util.SortedMap SortedMap}.
|
||||
* </p>
|
||||
* <p>
|
||||
* Note: In the 2.0 and 2.1 releases of Commons Collections, this class would
|
||||
* throw a {@link ClassCastException} if either of the arguments to
|
||||
@ -34,6 +35,7 @@ import java.util.Comparator;
|
||||
* {@link Comparable#compareTo(Object) compareTo} gave inconsistent results.
|
||||
* This is no longer the case. See {@link #compare(Object, Object) compare} for
|
||||
* details.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of objects compared by this comparator
|
||||
*
|
||||
|
@ -34,15 +34,18 @@ import java.util.List;
|
||||
* <p>
|
||||
* To further facilitate SQL-like sorting, the order of any single Comparator in
|
||||
* the list can be reversed.
|
||||
* </p>
|
||||
* <p>
|
||||
* Calling a method that adds new Comparators or changes the ascend/descend sort
|
||||
* <i>after compare(Object, Object) has been called</i> will result in an
|
||||
* UnsupportedOperationException. However, <i>take care</i> to not alter the
|
||||
* underlying List of Comparators or the BitSet that defines the sort order.
|
||||
* </p>
|
||||
* <p>
|
||||
* Instances of ComparatorChain are not synchronized. The class is not
|
||||
* thread-safe at construction time, but it <i>is</i> thread-safe to perform
|
||||
* multiple comparisons after all the setup operations are complete.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of objects compared by this comparator
|
||||
* @since 2.0
|
||||
|
@ -36,12 +36,15 @@ import java.util.Map;
|
||||
* <p>
|
||||
* Once <code>compare</code> has been called, the FixedOrderComparator is locked
|
||||
* and attempts to modify it yield an UnsupportedOperationException.
|
||||
* </p>
|
||||
* <p>
|
||||
* Instances of FixedOrderComparator are not synchronized. The class is not
|
||||
* thread-safe at construction time, but it is thread-safe to perform
|
||||
* multiple comparisons after all the setup operations are complete.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 4.0.
|
||||
* </p>
|
||||
*
|
||||
* @param <T> the type of objects compared by this comparator
|
||||
* @since 3.0
|
||||
|
@ -28,6 +28,7 @@ import org.apache.commons.collections4.Transformer;
|
||||
* {@link Comparator#compare(Object,Object) compare} method.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 4.0.
|
||||
* </p>
|
||||
*
|
||||
* @param <I> the input type to the transformer
|
||||
* @param <O> the output type from the transformer
|
||||
|
@ -31,6 +31,7 @@ import org.apache.commons.collections4.Predicate;
|
||||
* <p>
|
||||
* NOTE: In versions prior to 3.2 an array size of zero or one
|
||||
* threw an exception.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -27,6 +27,7 @@ import org.apache.commons.collections4.Predicate;
|
||||
* <p>
|
||||
* NOTE: In versions prior to 3.2 an array size of zero or one
|
||||
* threw an exception.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -26,6 +26,7 @@ import org.apache.commons.collections4.Transformer;
|
||||
* <p>
|
||||
* The input object is passed to the first transformer. The transformed result
|
||||
* is passed to the second transformer and so on.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -22,11 +22,13 @@ import org.apache.commons.collections4.Transformer;
|
||||
* Transformer implementation that returns a clone of the input object.
|
||||
* <p>
|
||||
* Clone is performed using <code>PrototypeFactory.prototypeFactory(input).create()</code>.
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>WARNING:</b> from v4.1 onwards this class will <b>not</b> be serializable anymore
|
||||
* in order to prevent potential remote code execution exploits. Please refer to
|
||||
* <a href="https://issues.apache.org/jira/browse/COLLECTIONS-580">COLLECTIONS-580</a>
|
||||
* for more details.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -26,6 +26,7 @@ import org.apache.commons.collections4.Factory;
|
||||
* No check is made that the object is immutable. In general, only immutable
|
||||
* objects should use the constant factory. Mutable objects should
|
||||
* use the prototype factory.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -26,6 +26,7 @@ import org.apache.commons.collections4.Transformer;
|
||||
* No check is made that the object is immutable. In general, only immutable
|
||||
* objects should use the constant factory. Mutable objects should
|
||||
* use the prototype factory.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -25,6 +25,7 @@ import org.apache.commons.collections4.Closure;
|
||||
* in order to prevent potential remote code execution exploits. Please refer to
|
||||
* <a href="https://issues.apache.org/jira/browse/COLLECTIONS-580">COLLECTIONS-580</a>
|
||||
* for more details.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ import org.apache.commons.collections4.FunctorException;
|
||||
* in order to prevent potential remote code execution exploits. Please refer to
|
||||
* <a href="https://issues.apache.org/jira/browse/COLLECTIONS-580">COLLECTIONS-580</a>
|
||||
* for more details.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ import org.apache.commons.collections4.Transformer;
|
||||
* in order to prevent potential remote code execution exploits. Please refer to
|
||||
* <a href="https://issues.apache.org/jira/browse/COLLECTIONS-580">COLLECTIONS-580</a>
|
||||
* for more details.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ import org.apache.commons.collections4.Transformer;
|
||||
* in order to prevent potential remote code execution exploits. Please refer to
|
||||
* <a href="https://issues.apache.org/jira/browse/COLLECTIONS-580">COLLECTIONS-580</a>
|
||||
* for more details.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -27,6 +27,7 @@ import org.apache.commons.collections4.Predicate;
|
||||
* <p>
|
||||
* NOTE: In versions prior to 3.2 an array size of zero or one
|
||||
* threw an exception.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -27,6 +27,7 @@ import org.apache.commons.collections4.Predicate;
|
||||
* <p>
|
||||
* NOTE: In versions prior to 3.2 an array size of zero or one
|
||||
* threw an exception.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -22,6 +22,7 @@ import org.apache.commons.collections4.Predicate;
|
||||
* Defines a predicate that decorates one or more other predicates.
|
||||
* <p>
|
||||
* This interface enables tools to access the decorated predicates.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.1
|
||||
*/
|
||||
|
@ -36,6 +36,7 @@ import org.apache.commons.collections4.FunctorException;
|
||||
* to prevent potential remote code execution exploits. Please refer to
|
||||
* <a href="https://issues.apache.org/jira/browse/COLLECTIONS-580">COLLECTIONS-580</a>
|
||||
* for more details.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -27,6 +27,7 @@ import org.apache.commons.collections4.Predicate;
|
||||
* in order to prevent potential remote code execution exploits. Please refer to
|
||||
* <a href="https://issues.apache.org/jira/browse/COLLECTIONS-580">COLLECTIONS-580</a>
|
||||
* for more details.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -21,6 +21,7 @@ import java.util.Iterator;
|
||||
* In case an offset parameter other than 0 is provided, the decorated
|
||||
* iterator is immediately advanced to this position, skipping all elements
|
||||
* before that position.
|
||||
* </p>
|
||||
*
|
||||
* @since 4.1
|
||||
*/
|
||||
|
@ -24,6 +24,7 @@ import org.apache.commons.collections4.Unmodifiable;
|
||||
* Decorates an iterator such that it cannot be modified.
|
||||
* <p>
|
||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -24,6 +24,7 @@ import org.apache.commons.collections4.Unmodifiable;
|
||||
* Decorates a list iterator such that it cannot be modified.
|
||||
* <p>
|
||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -23,6 +23,7 @@ import org.apache.commons.collections4.Unmodifiable;
|
||||
* Decorates a map iterator such that it cannot be modified.
|
||||
* <p>
|
||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -23,6 +23,7 @@ import org.apache.commons.collections4.Unmodifiable;
|
||||
* Decorates an ordered map iterator such that it cannot be modified.
|
||||
* <p>
|
||||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -30,6 +30,7 @@ import org.apache.commons.collections4.FluentIterable;
|
||||
* Given two {@link Iterator} instances {@code A} and {@code B}, the
|
||||
* {@link #next} method on this iterator will switch between {@code A.next()}
|
||||
* and {@code B.next()} until both iterators are exhausted.
|
||||
* </p>
|
||||
*
|
||||
* @since 4.1
|
||||
*/
|
||||
|
@ -26,6 +26,7 @@ import org.apache.commons.collections4.KeyValue;
|
||||
* <p>
|
||||
* Note that a <code>DefaultKeyValue</code> instance may not contain
|
||||
* itself as a key or value.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -26,8 +26,10 @@ import java.util.Arrays;
|
||||
* maps of maps. An example might be the need to look up a file name by
|
||||
* key and locale. The typical solution might be nested maps. This class
|
||||
* can be used instead by creating an instance passing in the key and locale.
|
||||
* </p>
|
||||
* <p>
|
||||
* Example usage:
|
||||
* </p>
|
||||
* <pre>
|
||||
* // populate map with data mapping key+locale to localizedText
|
||||
* Map map = new HashMap();
|
||||
|
@ -26,7 +26,8 @@ import org.apache.commons.collections4.KeyValue;
|
||||
* <p>
|
||||
* This can be used to enable a map entry to make changes on the underlying
|
||||
* map, however this will probably mess up any iterators.
|
||||
*
|
||||
* </p>
|
||||
s *
|
||||
* @since 3.0
|
||||
*/
|
||||
public class TiedMapEntry<K, V> implements Map.Entry<K, V>, KeyValue<K, V>, Serializable {
|
||||
|
@ -37,6 +37,7 @@ import org.apache.commons.collections4.OrderedIterator;
|
||||
* Overridable methods are provided to change the storage node and to change how
|
||||
* nodes are added to and removed. Hopefully, all you need for unusual subclasses
|
||||
* is here.
|
||||
* </p>
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
|
@ -26,6 +26,7 @@ import org.apache.commons.collections4.collection.AbstractCollectionDecorator;
|
||||
* Decorates another {@link List} to provide additional behaviour.
|
||||
* <p>
|
||||
* Methods are forwarded directly to the decorated list.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of the elements in the list
|
||||
* @since 3.0
|
||||
|
@ -35,6 +35,7 @@ import java.util.ListIterator;
|
||||
* This implementation supports all of the optional {@link List} operations.
|
||||
* It extends <code>AbstractLinkedList</code> and thus provides the
|
||||
* stack/queue/dequeue operations available in {@link java.util.LinkedList}.
|
||||
* </p>
|
||||
* <p>
|
||||
* The main feature of this class is the ability to modify the list and the
|
||||
* iterator at the same time. Both the {@link #listIterator()} and {@link #cursor()}
|
||||
@ -42,14 +43,17 @@ import java.util.ListIterator;
|
||||
* <code>ListIterator</code>. The cursor allows changes to the list concurrent
|
||||
* with changes to the iterator. Note that the {@link #iterator()} method and
|
||||
* sublists do <b>not</b> provide this cursor behaviour.
|
||||
* </p>
|
||||
* <p>
|
||||
* The <code>Cursor</code> class is provided partly for backwards compatibility
|
||||
* and partly because it allows the cursor to be directly closed. Closing the
|
||||
* cursor is optional because references are held via a <code>WeakReference</code>.
|
||||
* For most purposes, simply modify the iterator and list at will, and then let
|
||||
* the garbage collector to the rest.
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>Note that this implementation is not synchronized.</b>
|
||||
* </p>
|
||||
*
|
||||
* @see java.util.LinkedList
|
||||
* @since 1.0
|
||||
|
@ -31,13 +31,16 @@ import org.apache.commons.collections4.iterators.UnmodifiableIterator;
|
||||
* <p>
|
||||
* The add, remove, clear and retain operations are unsupported.
|
||||
* The set method is allowed (as it doesn't change the list size).
|
||||
* </p>
|
||||
* <p>
|
||||
* NOTE:
|
||||
* Modifying the decorated list directly would results in influencing the outcome
|
||||
* of method calls on this object. For example, the bounds of this list would reflect
|
||||
* a newly added object to the underlying list.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @param <E> the type of elements in this collection
|
||||
* @since 3.0
|
||||
|
@ -29,24 +29,30 @@ import java.util.List;
|
||||
* This class avoids errors by growing when a set or add method would
|
||||
* normally throw an IndexOutOfBoundsException.
|
||||
* Note that IndexOutOfBoundsException IS returned for invalid negative indices.
|
||||
* </p>
|
||||
* <p>
|
||||
* Trying to set or add to an index larger than the size will cause the list
|
||||
* to grow (using <code>null</code> elements). Clearly, care must be taken
|
||||
* not to use excessively large indices, as the internal list will grow to
|
||||
* match.
|
||||
* </p>
|
||||
* <p>
|
||||
* Trying to use any method other than add or set with an invalid index will
|
||||
* call the underlying list and probably result in an IndexOutOfBoundsException.
|
||||
* </p>
|
||||
* <p>
|
||||
* Take care when using this list with <code>null</code> values, as
|
||||
* <code>null</code> is the value added when growing the list.
|
||||
* </p>
|
||||
* <p>
|
||||
* All sub-lists will access the underlying list directly, and will throw
|
||||
* IndexOutOfBoundsExceptions.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class differs from {@link LazyList} because here growth occurs on
|
||||
* set and add, where <code>LazyList</code> grows on get. However, they
|
||||
* can be used together by decorating twice.
|
||||
* </p>
|
||||
*
|
||||
* @see LazyList
|
||||
* @since 3.2
|
||||
|
@ -29,8 +29,10 @@ import org.apache.commons.collections4.Factory;
|
||||
* If a get method call encounters a null, it will be replaced with a new
|
||||
* object from the factory. Thus this list is unsuitable for storing null
|
||||
* objects.
|
||||
* </p>
|
||||
* <p>
|
||||
* For instance:
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
* Factory<Date> factory = new Factory<Date>() {
|
||||
@ -42,16 +44,20 @@ import org.apache.commons.collections4.Factory;
|
||||
* Date date = lazy.get(3);
|
||||
* </pre>
|
||||
*
|
||||
* <p>
|
||||
* After the above code is executed, <code>date</code> will contain
|
||||
* a new <code>Date</code> instance. Furthermore, that <code>Date</code>
|
||||
* instance is the fourth element in the list. The first, second,
|
||||
* and third element are all set to <code>null</code>.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class differs from {@link GrowthList} because here growth occurs on
|
||||
* get, where <code>GrowthList</code> grows on set and add. However, they
|
||||
* could easily be used together by decorating twice.
|
||||
* </p>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
* </p>
|
||||
*
|
||||
* @see GrowthList
|
||||
* @since 3.0
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user