From 0eb36e1c78285b95d0ca7303763aabd19ff8f75a Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 9 Dec 2019 22:03:10 -0500 Subject: [PATCH] Javadoc: Replace HTML tags with Javadoc {@code} notation. --- .../commons/collections4/ArrayStack.java | 26 +-- .../org/apache/commons/collections4/Bag.java | 58 +++--- .../apache/commons/collections4/BagUtils.java | 4 +- .../apache/commons/collections4/BidiMap.java | 24 +-- .../collections4/BoundedCollection.java | 2 +- .../commons/collections4/BoundedMap.java | 2 +- .../apache/commons/collections4/Closure.java | 2 +- .../commons/collections4/ClosureUtils.java | 30 +-- .../commons/collections4/CollectionUtils.java | 184 ++++++++--------- .../commons/collections4/ComparatorUtils.java | 14 +- .../collections4/EnumerationUtils.java | 12 +- .../apache/commons/collections4/Factory.java | 2 +- .../commons/collections4/FactoryUtils.java | 10 +- .../commons/collections4/FluentIterable.java | 4 +- .../collections4/FunctorException.java | 12 +- .../org/apache/commons/collections4/Get.java | 10 +- .../commons/collections4/IterableGet.java | 2 +- .../commons/collections4/IterableUtils.java | 40 ++-- .../commons/collections4/IteratorUtils.java | 48 ++--- .../commons/collections4/ListUtils.java | 74 +++---- .../commons/collections4/MapIterator.java | 34 ++-- .../apache/commons/collections4/MapUtils.java | 188 +++++++++--------- .../apache/commons/collections4/MultiMap.java | 32 +-- .../commons/collections4/MultiMapUtils.java | 28 +-- .../apache/commons/collections4/MultiSet.java | 26 +-- .../commons/collections4/MultiSetUtils.java | 2 +- .../commons/collections4/MultiValuedMap.java | 6 +- .../commons/collections4/OrderedBidiMap.java | 6 +- .../commons/collections4/OrderedIterator.java | 2 +- .../commons/collections4/OrderedMap.java | 2 +- .../collections4/OrderedMapIterator.java | 6 +- .../commons/collections4/Predicate.java | 2 +- .../commons/collections4/PredicateUtils.java | 42 ++-- .../org/apache/commons/collections4/Put.java | 10 +- .../commons/collections4/QueueUtils.java | 4 +- .../apache/commons/collections4/SetUtils.java | 18 +- .../commons/collections4/SortedBag.java | 2 +- .../commons/collections4/SortedBidiMap.java | 6 +- .../commons/collections4/SplitMapUtils.java | 10 +- .../commons/collections4/Transformer.java | 2 +- .../collections4/TransformerUtils.java | 12 +- .../bag/AbstractBagDecorator.java | 2 +- .../collections4/bag/AbstractMapBag.java | 16 +- .../bag/AbstractSortedBagDecorator.java | 2 +- .../collections4/bag/CollectionBag.java | 28 +-- .../bidimap/AbstractDualBidiMap.java | 14 +- .../collections4/bidimap/DualHashBidiMap.java | 10 +- .../bidimap/DualLinkedHashBidiMap.java | 12 +- .../collections4/bidimap/DualTreeBidiMap.java | 8 +- .../collections4/bidimap/TreeBidiMap.java | 22 +- .../AbstractCollectionDecorator.java | 8 +- .../collection/CompositeCollection.java | 24 +-- .../UnmodifiableBoundedCollection.java | 4 +- .../comparators/BooleanComparator.java | 46 ++--- .../comparators/ComparableComparator.java | 14 +- .../comparators/ComparatorChain.java | 8 +- .../comparators/FixedOrderComparator.java | 8 +- .../comparators/NullComparator.java | 90 ++++----- .../comparators/ReverseComparator.java | 10 +- .../comparators/TransformingComparator.java | 10 +- .../collections4/functors/AllPredicate.java | 6 +- .../collections4/functors/AndPredicate.java | 4 +- .../collections4/functors/AnyPredicate.java | 6 +- .../collections4/functors/ChainedClosure.java | 6 +- .../functors/ChainedTransformer.java | 6 +- .../functors/CloneTransformer.java | 2 +- .../functors/ClosureTransformer.java | 4 +- .../functors/ComparatorPredicate.java | 28 +-- .../functors/ConstantFactory.java | 4 +- .../functors/ConstantTransformer.java | 4 +- .../collections4/functors/DefaultEquator.java | 6 +- .../collections4/functors/EqualPredicate.java | 4 +- .../functors/FactoryTransformer.java | 4 +- .../collections4/functors/ForClosure.java | 8 +- .../functors/IdentityPredicate.java | 2 +- .../collections4/functors/IfClosure.java | 8 +- .../collections4/functors/IfTransformer.java | 6 +- .../functors/InstanceofPredicate.java | 2 +- .../functors/InstantiateFactory.java | 4 +- .../functors/InstantiateTransformer.java | 2 +- .../functors/InvokerTransformer.java | 2 +- .../collections4/functors/MapTransformer.java | 4 +- .../collections4/functors/NonePredicate.java | 6 +- .../collections4/functors/NotPredicate.java | 2 +- .../functors/NullIsExceptionPredicate.java | 2 +- .../functors/NullIsFalsePredicate.java | 2 +- .../functors/NullIsTruePredicate.java | 2 +- .../collections4/functors/OnePredicate.java | 6 +- .../collections4/functors/OrPredicate.java | 4 +- .../functors/PredicateTransformer.java | 4 +- .../functors/PrototypeFactory.java | 2 +- .../functors/StringValueTransformer.java | 4 +- .../collections4/functors/SwitchClosure.java | 6 +- .../functors/SwitchTransformer.java | 6 +- .../functors/TransformedPredicate.java | 4 +- .../functors/TransformerClosure.java | 6 +- .../functors/TransformerPredicate.java | 2 +- .../functors/UniquePredicate.java | 2 +- .../collections4/functors/WhileClosure.java | 4 +- .../collections4/iterators/ArrayIterator.java | 12 +- .../iterators/ArrayListIterator.java | 24 +-- .../iterators/CollatingIterator.java | 26 +-- .../collections4/iterators/EmptyIterator.java | 2 +- .../iterators/EmptyListIterator.java | 2 +- .../iterators/EntrySetMapIterator.java | 30 +-- .../iterators/EnumerationIterator.java | 10 +- .../iterators/FilterIterator.java | 12 +- .../iterators/FilterListIterator.java | 12 +- .../collections4/iterators/IteratorChain.java | 6 +- .../iterators/IteratorEnumeration.java | 4 +- .../iterators/IteratorIterable.java | 10 +- .../iterators/ListIteratorWrapper.java | 18 +- .../iterators/LoopingIterator.java | 2 +- .../iterators/LoopingListIterator.java | 4 +- .../iterators/NodeListIterator.java | 2 +- .../iterators/ObjectArrayIterator.java | 6 +- .../iterators/ObjectArrayListIterator.java | 20 +- .../iterators/ObjectGraphIterator.java | 6 +- .../iterators/ReverseListIterator.java | 8 +- .../iterators/SingletonIterator.java | 8 +- .../iterators/SingletonListIterator.java | 4 +- .../iterators/TransformIterator.java | 6 +- .../iterators/UniqueFilterIterator.java | 2 +- .../iterators/ZippingIterator.java | 6 +- .../keyvalue/AbstractKeyValue.java | 2 +- .../keyvalue/AbstractMapEntry.java | 6 +- .../keyvalue/AbstractMapEntryDecorator.java | 4 +- .../keyvalue/DefaultKeyValue.java | 14 +- .../keyvalue/DefaultMapEntry.java | 4 +- .../collections4/keyvalue/MultiKey.java | 6 +- .../collections4/keyvalue/TiedMapEntry.java | 2 +- .../keyvalue/UnmodifiableMapEntry.java | 6 +- .../collections4/list/AbstractLinkedList.java | 32 +-- .../list/CursorableLinkedList.java | 34 ++-- .../collections4/list/FixedSizeList.java | 2 +- .../commons/collections4/list/GrowthList.java | 16 +- .../commons/collections4/list/LazyList.java | 10 +- .../list/NodeCachingLinkedList.java | 10 +- .../collections4/list/PredicatedList.java | 2 +- .../collections4/list/SetUniqueList.java | 24 +-- .../collections4/list/TransformedList.java | 2 +- .../commons/collections4/list/TreeList.java | 16 +- .../collections4/list/UnmodifiableList.java | 2 +- .../collections4/map/AbstractHashedMap.java | 56 +++--- .../map/AbstractInputCheckedMapDecorator.java | 8 +- .../collections4/map/AbstractLinkedMap.java | 22 +- .../map/AbstractReferenceMap.java | 34 ++-- .../collections4/map/CaseInsensitiveMap.java | 12 +- .../collections4/map/CompositeMap.java | 12 +- .../collections4/map/DefaultedMap.java | 8 +- .../collections4/map/FixedSizeMap.java | 2 +- .../collections4/map/FixedSizeSortedMap.java | 2 +- .../commons/collections4/map/Flat3Map.java | 4 +- .../commons/collections4/map/HashedMap.java | 4 +- .../commons/collections4/map/LRUMap.java | 20 +- .../commons/collections4/map/LazyMap.java | 6 +- .../collections4/map/LazySortedMap.java | 6 +- .../commons/collections4/map/LinkedMap.java | 14 +- .../collections4/map/ListOrderedMap.java | 22 +- .../commons/collections4/map/MultiKeyMap.java | 34 ++-- .../collections4/map/MultiValueMap.java | 36 ++-- .../collections4/map/PassiveExpiringMap.java | 24 +-- .../collections4/map/PredicatedMap.java | 4 +- .../collections4/map/PredicatedSortedMap.java | 2 +- .../map/ReferenceIdentityMap.java | 32 +-- .../collections4/map/ReferenceMap.java | 28 +-- .../collections4/map/SingletonMap.java | 16 +- .../collections4/map/StaticBucketMap.java | 8 +- .../collections4/map/TransformedMap.java | 4 +- .../map/TransformedSortedMap.java | 2 +- .../map/UnmodifiableEntrySet.java | 2 +- .../collections4/map/UnmodifiableMap.java | 2 +- .../map/UnmodifiableOrderedMap.java | 2 +- .../map/UnmodifiableSortedMap.java | 2 +- .../multimap/AbstractListValuedMap.java | 4 +- .../multimap/AbstractMultiValuedMap.java | 6 +- .../AbstractMultiValuedMapDecorator.java | 6 +- .../multimap/AbstractSetValuedMap.java | 8 +- .../multimap/ArrayListValuedHashMap.java | 4 +- .../multimap/HashSetValuedHashMap.java | 4 +- .../multimap/TransformedMultiValuedMap.java | 2 +- .../multiset/AbstractMultiSetDecorator.java | 2 +- .../apache/commons/collections4/overview.html | 14 +- .../collections4/sequence/DeleteCommand.java | 2 +- .../collections4/sequence/EditCommand.java | 6 +- .../collections4/sequence/EditScript.java | 2 +- .../collections4/sequence/InsertCommand.java | 2 +- .../collections4/sequence/KeepCommand.java | 4 +- .../sequence/ReplacementsHandler.java | 4 +- .../sequence/SequencesComparator.java | 22 +- .../collections4/sequence/package-info.java | 22 +- .../set/AbstractNavigableSetDecorator.java | 2 +- .../set/AbstractSetDecorator.java | 2 +- .../set/AbstractSortedSetDecorator.java | 2 +- .../collections4/set/CompositeSet.java | 28 +-- .../collections4/set/ListOrderedSet.java | 22 +- .../collections4/set/MapBackedSet.java | 8 +- .../set/PredicatedNavigableSet.java | 2 +- .../collections4/set/PredicatedSet.java | 2 +- .../collections4/set/PredicatedSortedSet.java | 2 +- .../set/TransformedNavigableSet.java | 2 +- .../collections4/set/TransformedSet.java | 2 +- .../set/TransformedSortedSet.java | 2 +- .../set/UnmodifiableNavigableSet.java | 2 +- .../collections4/set/UnmodifiableSet.java | 2 +- .../set/UnmodifiableSortedSet.java | 2 +- .../splitmap/TransformedSplitMap.java | 4 +- 207 files changed, 1294 insertions(+), 1294 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/ArrayStack.java b/src/main/java/org/apache/commons/collections4/ArrayStack.java index 7834d2d02..51fe2a310 100644 --- a/src/main/java/org/apache/commons/collections4/ArrayStack.java +++ b/src/main/java/org/apache/commons/collections4/ArrayStack.java @@ -21,18 +21,18 @@ import java.util.EmptyStackException; /** * An implementation of the {@link java.util.Stack} API that is based on an - * ArrayList instead of a Vector, so it is not + * {@code ArrayList} instead of a {@code Vector}, so it is not * synchronized to protect against multi-threaded access. The implementation * is therefore operates faster in environments where you do not need to * worry about multiple thread contention. *

- * The removal order of an ArrayStack is based on insertion + * The removal order of an {@code ArrayStack} is based on insertion * order: The most recently added element is removed first. The iteration * order is not the same as the removal order. The iterator returns * elements from the bottom up. *

*

- * Unlike Stack, ArrayStack accepts null entries. + * Unlike {@code Stack}, {@code ArrayStack} accepts null entries. *

* Note: From version 4.0 onwards, this class does not implement the * removed {@code Buffer} interface anymore. @@ -50,15 +50,15 @@ public class ArrayStack extends ArrayList { private static final long serialVersionUID = 2130079159931574599L; /** - * Constructs a new empty ArrayStack. The initial size - * is controlled by ArrayList and is currently 10. + * Constructs a new empty {@code ArrayStack}. The initial size + * is controlled by {@code ArrayList} and is currently 10. */ public ArrayStack() { super(); } /** - * Constructs a new empty ArrayStack with an initial size. + * Constructs a new empty {@code ArrayStack} with an initial size. * * @param initialSize the initial size to use * @throws IllegalArgumentException if the specified initial size @@ -69,10 +69,10 @@ public class ArrayStack extends ArrayList { } /** - * Return true if this stack is currently empty. + * Return {@code true} if this stack is currently empty. *

- * This method exists for compatibility with java.util.Stack. - * New users of this class should use isEmpty instead. + * This method exists for compatibility with {@code java.util.Stack}. + * New users of this class should use {@code isEmpty} instead. * * @return true if the stack is currently empty */ @@ -127,7 +127,7 @@ public class ArrayStack extends ArrayList { /** * Pushes a new item onto the top of this stack. The pushed item is also - * returned. This is equivalent to calling add. + * returned. This is equivalent to calling {@code add}. * * @param item the item to be added * @return the item just pushed @@ -140,9 +140,9 @@ public class ArrayStack extends ArrayList { /** * Returns the one-based position of the distance from the top that the * specified object exists on this stack, where the top-most element is - * considered to be at distance 1. If the object is not - * present on the stack, return -1 instead. The - * equals() method is used to compare to the items + * considered to be at distance {@code 1}. If the object is not + * present on the stack, return {@code -1} instead. The + * {@code equals()} method is used to compare to the items * in this stack. * * @param object the object to be searched for diff --git a/src/main/java/org/apache/commons/collections4/Bag.java b/src/main/java/org/apache/commons/collections4/Bag.java index 04a9c7864..115d4d75e 100644 --- a/src/main/java/org/apache/commons/collections4/Bag.java +++ b/src/main/java/org/apache/commons/collections4/Bag.java @@ -24,16 +24,16 @@ import java.util.Set; * Defines a collection that counts the number of times an object appears in * the collection. *

- * Suppose you have a Bag that contains {a, a, b, c}. - * Calling {@link #getCount(Object)} on a would return 2, while - * calling {@link #uniqueSet()} would return {a, b, c}. + * Suppose you have a Bag that contains {@code {a, a, b, c}}. + * Calling {@link #getCount(Object)} on {@code a} would return 2, while + * calling {@link #uniqueSet()} would return {@code {a, b, c}}. *

*

* NOTE: This interface violates the {@link Collection} contract. * The behavior specified in many of these methods is not the same - * as the behavior specified by Collection. + * as the behavior specified by {@code Collection}. * The noncompliant methods are clearly marked with "(Violation)". - * Exercise caution when using a bag as a Collection. + * Exercise caution when using a bag as a {@code Collection}. *

*

* This violation resulted from the original specification of this interface. @@ -67,27 +67,27 @@ public interface Bag extends Collection { *

* Since this method always increases the size of the bag, * according to the {@link Collection#add(Object)} contract, it - * should always return true. Since it sometimes returns - * false, this method violates the contract. + * should always return {@code true}. Since it sometimes returns + * {@code false}, this method violates the contract. *

* * @param object the object to add - * @return true if the object was not already in the uniqueSet + * @return {@code true} if the object was not already in the {@code uniqueSet} */ @Override boolean add(E object); /** - * Adds nCopies copies of the specified object to the Bag. + * Adds {@code nCopies} copies of the specified object to the Bag. *

* If the object is already in the {@link #uniqueSet()} then increment its * count as reported by {@link #getCount(Object)}. Otherwise add it to the - * {@link #uniqueSet()} and report its count as nCopies. + * {@link #uniqueSet()} and report its count as {@code nCopies}. *

* * @param object the object to add * @param nCopies the number of copies to add - * @return true if the object was not already in the uniqueSet + * @return {@code true} if the object was not already in the {@code uniqueSet} */ boolean add(E object, int nCopies); @@ -104,13 +104,13 @@ public interface Bag extends Collection { *

* * @param object the object to remove - * @return true if this call changed the collection + * @return {@code true} if this call changed the collection */ @Override boolean remove(Object object); /** - * Removes nCopies copies of the specified object from the Bag. + * Removes {@code nCopies} copies of the specified object from the Bag. *

* If the number of copies to remove is greater than the actual number of * copies in the Bag, no error is thrown. @@ -118,7 +118,7 @@ public interface Bag extends Collection { * * @param object the object to remove * @param nCopies the number of copies to remove - * @return true if this call changed the collection + * @return {@code true} if this call changed the collection */ boolean remove(Object object, int nCopies); @@ -142,11 +142,11 @@ public interface Bag extends Collection { /** * (Violation) - * Returns true if the bag contains all elements in + * Returns {@code true} if the bag contains all elements in * the given collection, respecting cardinality. That is, if the - * given collection coll contains n copies + * given collection {@code coll} contains {@code n} copies * of a given object, calling {@link #getCount(Object)} on that object must - * be >= n for all n in coll. + * be {@code >= n} for all {@code n} in {@code coll}. * *

* The {@link Collection#containsAll(Collection)} method specifies @@ -156,7 +156,7 @@ public interface Bag extends Collection { *

* * @param coll the collection to check against - * @return true if the Bag contains all the collection + * @return {@code true} if the Bag contains all the collection */ @Override boolean containsAll(Collection coll); @@ -165,9 +165,9 @@ public interface Bag extends Collection { * (Violation) * Remove all elements represented in the given collection, * respecting cardinality. That is, if the given collection - * coll contains n copies of a given object, - * the bag will have n fewer copies, assuming the bag - * had at least n copies to begin with. + * {@code coll} contains {@code n} copies of a given object, + * the bag will have {@code n} fewer copies, assuming the bag + * had at least {@code n} copies to begin with. * *

* The {@link Collection#removeAll(Collection)} method specifies @@ -177,7 +177,7 @@ public interface Bag extends Collection { *

* * @param coll the collection to remove - * @return true if this call changed the collection + * @return {@code true} if this call changed the collection */ @Override boolean removeAll(Collection coll); @@ -186,11 +186,11 @@ public interface Bag extends Collection { * (Violation) * Remove any members of the bag that are not in the given * collection, respecting cardinality. That is, if the given - * collection coll contains n copies of a - * given object and the bag has m > n copies, then - * delete m - n copies from the bag. In addition, if - * e is an object in the bag but - * !coll.contains(e), then remove e and any + * collection {@code coll} contains {@code n} copies of a + * given object and the bag has {@code m > n} copies, then + * delete {@code m - n} copies from the bag. In addition, if + * {@code e} is an object in the bag but + * {@code !coll.contains(e)}, then remove {@code e} and any * of its copies. * *

@@ -201,7 +201,7 @@ public interface Bag extends Collection { *

* * @param coll the collection to retain - * @return true if this call changed the collection + * @return {@code true} if this call changed the collection */ @Override boolean retainAll(Collection coll); @@ -233,7 +233,7 @@ public interface Bag extends Collection { // * Gets a hash code for the Bag compatible with the definition of equals. // * The hash code is defined as the sum total of a hash code for each element. // * The per element hash code is defined as -// * (e==null ? 0 : e.hashCode()) ^ noOccurances). +// * {@code (e==null ? 0 : e.hashCode()) ^ noOccurances)}. // * This hash code definition is compatible with the Set interface. // * // * @return the hash code of the Bag diff --git a/src/main/java/org/apache/commons/collections4/BagUtils.java b/src/main/java/org/apache/commons/collections4/BagUtils.java index 931a218c1..b5da468f7 100644 --- a/src/main/java/org/apache/commons/collections4/BagUtils.java +++ b/src/main/java/org/apache/commons/collections4/BagUtils.java @@ -246,7 +246,7 @@ public class BagUtils { } /** - * Get an empty Bag. + * Get an empty {@code Bag}. * * @param the element type * @return an empty Bag @@ -257,7 +257,7 @@ public class BagUtils { } /** - * Get an empty SortedBag. + * Get an empty {@code SortedBag}. * * @param the element type * @return an empty sorted Bag diff --git a/src/main/java/org/apache/commons/collections4/BidiMap.java b/src/main/java/org/apache/commons/collections4/BidiMap.java index 2d9bceac3..5834ae40d 100644 --- a/src/main/java/org/apache/commons/collections4/BidiMap.java +++ b/src/main/java/org/apache/commons/collections4/BidiMap.java @@ -21,11 +21,11 @@ import java.util.Set; /** * Defines a map that allows bidirectional lookup between key and values. *

- * This extended Map represents a mapping where a key may + * This extended {@code Map} represents a mapping where a key may * lookup a value and a value may lookup a key with equal ease. - * This interface extends Map and so may be used anywhere a map + * This interface extends {@code Map} and so may be used anywhere a map * is required. The interface provides an inverse map view, enabling - * full access to both directions of the BidiMap. + * full access to both directions of the {@code BidiMap}. *

*

* Implementations should allow a value to be looked up from a key and @@ -66,7 +66,7 @@ public interface BidiMap extends IterableMap { * @param value the value to store * @return the previous value mapped to this key * - * @throws UnsupportedOperationException if the put method is not supported + * @throws UnsupportedOperationException if the {@code put} method is not supported * @throws ClassCastException (optional) if the map limits the type of the * value and the specified value is inappropriate * @throws IllegalArgumentException (optional) if the map limits the values @@ -80,15 +80,15 @@ public interface BidiMap extends IterableMap { /** * Gets the key that is currently mapped to the specified value. *

- * If the value is not contained in the map, null is returned. + * If the value is not contained in the map, {@code null} is returned. *

*

* Implementations should seek to make this method perform equally as well - * as get(Object). + * as {@code get(Object)}. *

* * @param value the value to find the key for - * @return the mapped key, or null if not found + * @return the mapped key, or {@code null} if not found * * @throws ClassCastException (optional) if the map limits the type of the * value and the specified value is inappropriate @@ -101,15 +101,15 @@ public interface BidiMap extends IterableMap { * Removes the key-value pair that is currently mapped to the specified * value (optional operation). *

- * If the value is not contained in the map, null is returned. + * If the value is not contained in the map, {@code null} is returned. *

*

* Implementations should seek to make this method perform equally as well - * as remove(Object). + * as {@code remove(Object)}. *

* * @param value the value to find the key-value pair for - * @return the key that was removed, null if nothing removed + * @return the key that was removed, {@code null} if nothing removed * * @throws ClassCastException (optional) if the map limits the type of the * value and the specified value is inappropriate @@ -124,11 +124,11 @@ public interface BidiMap extends IterableMap { * Gets a view of this map where the keys and values are reversed. *

* Changes to one map will be visible in the other and vice versa. - * This enables both directions of the map to be accessed as a Map. + * This enables both directions of the map to be accessed as a {@code Map}. *

*

* Implementations should seek to avoid creating a new object every time this - * method is called. See AbstractMap.values() etc. Calling this + * method is called. See {@code AbstractMap.values()} etc. Calling this * method on the inverse map should return the original. *

* diff --git a/src/main/java/org/apache/commons/collections4/BoundedCollection.java b/src/main/java/org/apache/commons/collections4/BoundedCollection.java index a5d2c01b3..d07fbd991 100644 --- a/src/main/java/org/apache/commons/collections4/BoundedCollection.java +++ b/src/main/java/org/apache/commons/collections4/BoundedCollection.java @@ -37,7 +37,7 @@ public interface BoundedCollection extends Collection { /** * Returns true if this collection is full and no new elements can be added. * - * @return true if the collection is full. + * @return {@code true} if the collection is full. */ boolean isFull(); diff --git a/src/main/java/org/apache/commons/collections4/BoundedMap.java b/src/main/java/org/apache/commons/collections4/BoundedMap.java index 61a3bb4a5..3a45372fe 100644 --- a/src/main/java/org/apache/commons/collections4/BoundedMap.java +++ b/src/main/java/org/apache/commons/collections4/BoundedMap.java @@ -33,7 +33,7 @@ public interface BoundedMap extends IterableMap { /** * Returns true if this map is full and no new elements can be added. * - * @return true if the map is full + * @return {@code true} if the map is full */ boolean isFull(); diff --git a/src/main/java/org/apache/commons/collections4/Closure.java b/src/main/java/org/apache/commons/collections4/Closure.java index 51ff59c6c..73dcbfb0a 100644 --- a/src/main/java/org/apache/commons/collections4/Closure.java +++ b/src/main/java/org/apache/commons/collections4/Closure.java @@ -19,7 +19,7 @@ package org.apache.commons.collections4; /** * Defines a functor interface implemented by classes that do something. *

- * A Closure represents a block of code which is executed from + * A {@code Closure} represents a block of code which is executed from * inside some block, function or iteration. It operates an input object. *

*

diff --git a/src/main/java/org/apache/commons/collections4/ClosureUtils.java b/src/main/java/org/apache/commons/collections4/ClosureUtils.java index 44365a024..bee58541b 100644 --- a/src/main/java/org/apache/commons/collections4/ClosureUtils.java +++ b/src/main/java/org/apache/commons/collections4/ClosureUtils.java @@ -32,7 +32,7 @@ import org.apache.commons.collections4.functors.TransformerClosure; import org.apache.commons.collections4.functors.WhileClosure; /** - * ClosureUtils provides reference implementations and utilities + * {@code ClosureUtils} provides reference implementations and utilities * for the Closure functor interface. The supplied closures are: *

    *
  • Invoker - invokes a method on the input object @@ -107,16 +107,16 @@ public class ClosureUtils { } /** - * Creates a Closure that will call the closure count times. + * Creates a Closure that will call the closure {@code count} times. *

    - * A null closure or zero count returns the NOPClosure. + * A null closure or zero count returns the {@code NOPClosure}. * * @see org.apache.commons.collections4.functors.ForClosure * * @param the type that the closure acts on * @param count the number of times to loop * @param closure the closure to call repeatedly - * @return the for closure + * @return the {@code for} closure */ public static Closure forClosure(final int count, final Closure closure) { return ForClosure.forClosure(count, closure); @@ -131,7 +131,7 @@ public class ClosureUtils { * @param the type that the closure acts on * @param predicate the predicate to use as an end of loop test, not null * @param closure the closure to call repeatedly, not null - * @return the while closure + * @return the {@code while} closure * @throws NullPointerException if either argument is null */ public static Closure whileClosure(final Predicate predicate, final Closure closure) { @@ -147,7 +147,7 @@ public class ClosureUtils { * @param the type that the closure acts on * @param closure the closure to call repeatedly, not null * @param predicate the predicate to use as an end of loop test, not null - * @return the do-while closure + * @return the {@code do-while} closure * @throws NullPointerException if either argument is null */ public static Closure doWhileClosure(final Closure closure, @@ -164,7 +164,7 @@ public class ClosureUtils { * * @param the type that the closure acts on * @param methodName the name of the method - * @return the invoker closure + * @return the {@code invoker} closure * @throws NullPointerException if the method name is null */ public static Closure invokerClosure(final String methodName) { @@ -183,7 +183,7 @@ public class ClosureUtils { * @param methodName the name of the method * @param paramTypes the parameter types * @param args the arguments - * @return the invoker closure + * @return the {@code invoker} closure * @throws NullPointerException if the method name is null * @throws IllegalArgumentException if the paramTypes and args don't match */ @@ -201,7 +201,7 @@ public class ClosureUtils { * * @param the type that the closure acts on * @param closures an array of closures to chain - * @return the chained closure + * @return the {@code chained} closure * @throws NullPointerException if the closures array is null * @throws NullPointerException if any closure in the array is null */ @@ -218,7 +218,7 @@ public class ClosureUtils { * * @param the type that the closure acts on * @param closures a collection of closures to chain - * @return the chained closure + * @return the {@code chained} closure * @throws NullPointerException if the closures collection is null * @throws NullPointerException if any closure in the collection is null * @throws IllegalArgumentException if the closures collection is empty @@ -236,7 +236,7 @@ public class ClosureUtils { * @param the type that the closure acts on * @param predicate the validating predicate * @param trueClosure the closure called if the predicate is true - * @return the if closure + * @return the {@code if} closure * @throws NullPointerException if the predicate or closure is null * @since 3.2 */ @@ -255,7 +255,7 @@ public class ClosureUtils { * @param predicate the predicate to switch on * @param trueClosure the closure called if the predicate is true * @param falseClosure the closure called if the predicate is false - * @return the switch closure + * @return the {@code switch} closure * @throws NullPointerException if the predicate or either closure is null */ public static Closure ifClosure(final Predicate predicate, @@ -277,7 +277,7 @@ public class ClosureUtils { * @param the type that the closure acts on * @param predicates an array of predicates to check, not null * @param closures an array of closures to call, not null - * @return the switch closure + * @return the {@code switch} closure * @throws NullPointerException if the either array is null * @throws NullPointerException if any element in the arrays is null * @throws IllegalArgumentException if the arrays have different sizes @@ -302,7 +302,7 @@ public class ClosureUtils { * @param predicates an array of predicates to check, not null * @param closures an array of closures to call, not null * @param defaultClosure the default to call if no predicate matches - * @return the switch closure + * @return the {@code switch} closure * @throws NullPointerException if the either array is null * @throws NullPointerException if any element in the arrays is null * @throws IllegalArgumentException if the arrays are different sizes @@ -328,7 +328,7 @@ public class ClosureUtils { * * @param the type that the closure acts on * @param predicatesAndClosures a map of predicates to closures - * @return the switch closure + * @return the {@code switch} closure * @throws NullPointerException if the map is null * @throws NullPointerException if any closure in the map is null * @throws IllegalArgumentException if the map is empty diff --git a/src/main/java/org/apache/commons/collections4/CollectionUtils.java b/src/main/java/org/apache/commons/collections4/CollectionUtils.java index 26e265ea4..1030a584a 100644 --- a/src/main/java/org/apache/commons/collections4/CollectionUtils.java +++ b/src/main/java/org/apache/commons/collections4/CollectionUtils.java @@ -185,7 +185,7 @@ public class CollectionUtils { public static final Collection EMPTY_COLLECTION = Collections.emptyList(); /** - * CollectionUtils should not normally be instantiated. + * {@code CollectionUtils} should not normally be instantiated. */ private CollectionUtils() {} @@ -203,12 +203,12 @@ public class CollectionUtils { } /** - * Returns an immutable empty collection if the argument is null, + * Returns an immutable empty collection if the argument is {@code null}, * or the argument itself otherwise. * * @param the element type - * @param collection the collection, possibly null - * @return an empty collection if the argument is null + * @param collection the collection, possibly {@code null} + * @return an empty collection if the argument is {@code null} */ public static Collection emptyIfNull(final Collection collection) { return collection == null ? CollectionUtils.emptyCollection() : collection; @@ -355,11 +355,11 @@ public class CollectionUtils { } /** - * Returns true iff all elements of {@code coll2} are also contained + * Returns {@code true} iff all elements of {@code coll2} are also contained * in {@code coll1}. The cardinality of values in {@code coll2} is not taken into account, * which is the same behavior as {@link Collection#containsAll(Collection)}. *

    - * In other words, this method returns true iff the + * In other words, this method returns {@code true} iff the * {@link #intersection} of coll1 and coll2 has the same cardinality as * the set of unique values from {@code coll2}. In case {@code coll2} is empty, {@code true} * will be returned. @@ -374,7 +374,7 @@ public class CollectionUtils { * * @param coll1 the first collection, must not be null * @param coll2 the second collection, must not be null - * @return true iff the intersection of the collections has the same cardinality + * @return {@code true} iff the intersection of the collections has the same cardinality * as the set of unique elements from the second collection * @since 4.0 */ @@ -407,16 +407,16 @@ public class CollectionUtils { } /** - * Returns true iff at least one element is in both collections. + * Returns {@code true} iff at least one element is in both collections. *

    - * In other words, this method returns true iff the + * In other words, this method returns {@code true} iff the * {@link #intersection} of coll1 and coll2 is not empty. *

    * - * @param the type of object to lookup in coll1. + * @param the type of object to lookup in {@code coll1}. * @param coll1 the first collection, must not be null * @param coll2 the second collection, must not be null - * @return true iff the intersection of the collections is non-empty + * @return {@code true} iff the intersection of the collections is non-empty * @since 4.2 * @see #intersection */ @@ -438,15 +438,15 @@ public class CollectionUtils { } /** - * Returns true iff at least one element is in both collections. + * Returns {@code true} iff at least one element is in both collections. *

    - * In other words, this method returns true iff the + * In other words, this method returns {@code true} iff the * {@link #intersection} of coll1 and coll2 is not empty. *

    * * @param coll1 the first collection, must not be null * @param coll2 the second collection, must not be null - * @return true iff the intersection of the collections is non-empty + * @return {@code true} iff the intersection of the collections is non-empty * @since 2.1 * @see #intersection */ @@ -501,7 +501,7 @@ public class CollectionUtils { * * @param a the first (sub?) collection, must not be null * @param b the second (super?) collection, must not be null - * @return true iff a is a sub-collection of b + * @return {@code true} iff a is a sub-collection of b * @see #isProperSubCollection * @see Collection#containsAll */ @@ -526,14 +526,14 @@ public class CollectionUtils { * The implementation assumes *

    *
      - *
    • a.size() and b.size() represent the + *
    • {@code a.size()} and {@code b.size()} represent the * total cardinality of a and b, resp.
    • - *
    • a.size() < Integer.MAXVALUE
    • + *
    • {@code a.size() < Integer.MAXVALUE}
    • *
    * * @param a the first (sub?) collection, must not be null * @param b the second (super?) collection, must not be null - * @return true iff a is a proper sub-collection of b + * @return {@code true} iff a is a proper sub-collection of b * @see #isSubCollection * @see Collection#containsAll */ @@ -552,7 +552,7 @@ public class CollectionUtils { * * @param a the first collection, must not be null * @param b the second collection, must not be null - * @return true iff the collections contain the same elements with the same cardinalities. + * @return {@code true} iff the collections contain the same elements with the same cardinalities. */ public static boolean isEqualCollection(final Collection a, final Collection b) { if(a.size() != b.size()) { @@ -589,7 +589,7 @@ public class CollectionUtils { * @param a the first collection, must not be null * @param b the second collection, must not be null * @param equator the Equator used for testing equality - * @return true iff the collections contain the same elements with the same cardinalities. + * @return {@code true} iff the collections contain the same elements with the same cardinalities. * @throws NullPointerException if the equator is null * @since 4.0 */ @@ -792,7 +792,7 @@ public class CollectionUtils { * Filter the collection by applying a Predicate to each element. If the * predicate returns true, remove the element. *

    - * This is equivalent to filter(collection, PredicateUtils.notPredicate(predicate)) + * This is equivalent to {@code filter(collection, PredicateUtils.notPredicate(predicate))} * if predicate is != null. *

    *

    @@ -849,7 +849,7 @@ public class CollectionUtils { * Counts the number of elements in the input collection that match the * predicate. *

    - * A null collection or predicate matches no elements. + * A {@code null} collection or predicate matches no elements. *

    * * @param the type of object the {@link Iterable} contains @@ -867,7 +867,7 @@ public class CollectionUtils { * Answers true if a predicate is true for at least one element of a * collection. *

    - * A null collection or predicate returns false. + * A {@code null} collection or predicate returns false. *

    * * @param the type of object the {@link Iterable} contains @@ -886,10 +886,10 @@ public class CollectionUtils { * collection. * *

    - * A null predicate returns false. + * A {@code null} predicate returns false. *

    *

    - * A null or empty collection returns true. + * A {@code null} or empty collection returns true. *

    * * @param the type of object the {@link Iterable} contains @@ -909,7 +909,7 @@ public class CollectionUtils { * Selects all elements from input collection which match the given * predicate into an output collection. *

    - * A null predicate matches no elements. + * A {@code null} predicate matches no elements. *

    * * @param the type of object the {@link Iterable} contains @@ -958,12 +958,12 @@ public class CollectionUtils { * Selects all elements from inputCollection into an output and rejected collection, * based on the evaluation of the given predicate. *

    - * Elements matching the predicate are added to the outputCollection, - * all other elements are added to the rejectedCollection. + * Elements matching the predicate are added to the {@code outputCollection}, + * all other elements are added to the {@code rejectedCollection}. *

    *

    - * If the input predicate is null, no elements are added to - * outputCollection or rejectedCollection. + * If the input predicate is {@code null}, no elements are added to + * {@code outputCollection} or {@code rejectedCollection}. *

    *

    * Note: calling the method is equivalent to the following code snippet: @@ -1003,7 +1003,7 @@ public class CollectionUtils { * Selects all elements from inputCollection which don't match the given * predicate into an output collection. *

    - * If the input predicate is null, the result is an empty + * If the input predicate is {@code null}, the result is an empty * list. *

    * @@ -1024,8 +1024,8 @@ public class CollectionUtils { * Selects all elements from inputCollection which don't match the given * predicate and adds them to outputCollection. *

    - * If the input predicate is null, no elements are added to - * outputCollection. + * If the input predicate is {@code null}, no elements are added to + * {@code outputCollection}. *

    * * @param the type of object the {@link Iterable} contains @@ -1232,11 +1232,11 @@ public class CollectionUtils { } /** - * Returns the index-th value in {@link Iterator}, throwing - * IndexOutOfBoundsException if there is no such element. + * Returns the {@code index}-th value in {@link Iterator}, throwing + * {@code IndexOutOfBoundsException} if there is no such element. *

    - * The Iterator is advanced to index (or to the end, if - * index exceeds the number of entries) as a side effect of this method. + * The Iterator is advanced to {@code index} (or to the end, if + * {@code index} exceeds the number of entries) as a side effect of this method. *

    * * @param iterator the iterator to get a value from @@ -1264,8 +1264,8 @@ public class CollectionUtils { } /** - * Returns the index-th value in the iterable's {@link Iterator}, throwing - * IndexOutOfBoundsException if there is no such element. + * Returns the {@code index}-th value in the {@code iterable}'s {@link Iterator}, throwing + * {@code IndexOutOfBoundsException} if there is no such element. *

    * If the {@link Iterable} is a {@link List}, then it will use {@link List#get(int)}. *

    @@ -1283,27 +1283,27 @@ public class CollectionUtils { } /** - * Returns the index-th value in object, throwing - * IndexOutOfBoundsException if there is no such element or - * IllegalArgumentException if object is not an + * Returns the {@code index}-th value in {@code object}, throwing + * {@code IndexOutOfBoundsException} if there is no such element or + * {@code IllegalArgumentException} if {@code object} is not an * instance of one of the supported types. *

    * The supported types, and associated semantics are: *

    *
      - *
    • Map -- the value returned is the Map.Entry in position - * index in the map's entrySet iterator, + *
    • Map -- the value returned is the {@code Map.Entry} in position + * {@code index} in the map's {@code entrySet} iterator, * if there is such an entry.
    • *
    • List -- this method is equivalent to the list's get method.
    • - *
    • Array -- the index-th array entry is returned, - * if there is such an entry; otherwise an IndexOutOfBoundsException + *
    • Array -- the {@code index}-th array entry is returned, + * if there is such an entry; otherwise an {@code IndexOutOfBoundsException} * is thrown.
    • - *
    • Collection -- the value returned is the index-th object + *
    • Collection -- the value returned is the {@code index}-th object * returned by the collection's default iterator, if there is such an element.
    • *
    • Iterator or Enumeration -- the value returned is the - * index-th object in the Iterator/Enumeration, if there + * {@code index}-th object in the Iterator/Enumeration, if there * is such an element. The Iterator/Enumeration is advanced to - * index (or to the end, if index exceeds the + * {@code index} (or to the end, if {@code index} exceeds the * number of entries) as a side effect of this method.
    • *
    * @@ -1345,8 +1345,8 @@ public class CollectionUtils { } /** - * Returns the index-th Map.Entry in the map's entrySet, - * throwing IndexOutOfBoundsException if there is no such element. + * Returns the {@code index}-th {@code Map.Entry} in the {@code map}'s {@code entrySet}, + * throwing {@code IndexOutOfBoundsException} if there is no such element. * * @param the key type in the {@link Map} * @param the key type in the {@link Map} @@ -1708,25 +1708,25 @@ public class CollectionUtils { //----------------------------------------------------------------------- /** - * Returns a collection containing all the elements in collection - * that are also in retain. The cardinality of an element e - * in the returned collection is the same as the cardinality of e - * in collection unless retain does not contain e, in which + * Returns a collection containing all the elements in {@code collection} + * that are also in {@code retain}. The cardinality of an element {@code e} + * in the returned collection is the same as the cardinality of {@code e} + * in {@code collection} unless {@code retain} does not contain {@code e}, in which * case the cardinality is zero. This method is useful if you do not wish to modify - * the collection c and thus cannot call c.retainAll(retain);. + * the collection {@code c} and thus cannot call {@code c.retainAll(retain);}. *

    - * This implementation iterates over collection, checking each element in - * turn to see if it's contained in retain. If it's contained, it's added + * This implementation iterates over {@code collection}, checking each element in + * turn to see if it's contained in {@code retain}. If it's contained, it's added * to the returned list. As a consequence, it is advised to use a collection type for - * retain that provides a fast (e.g. O(1)) implementation of + * {@code retain} that provides a fast (e.g. O(1)) implementation of * {@link Collection#contains(Object)}. *

    * * @param the type of object the {@link Collection} contains * @param collection the collection whose contents are the target of the #retailAll operation * @param retain the collection containing the elements to be retained in the returned collection - * @return a Collection containing all the elements of collection - * that occur at least once in retain. + * @return a {@code Collection} containing all the elements of {@code collection} + * that occur at least once in {@code retain}. * @throws NullPointerException if either parameter is null * @since 3.2 */ @@ -1736,17 +1736,17 @@ public class CollectionUtils { /** * Returns a collection containing all the elements in - * collection that are also in retain. The - * cardinality of an element e in the returned collection is - * the same as the cardinality of e in collection - * unless retain does not contain e, in which case + * {@code collection} that are also in {@code retain}. The + * cardinality of an element {@code e} in the returned collection is + * the same as the cardinality of {@code e} in {@code collection} + * unless {@code retain} does not contain {@code e}, in which case * the cardinality is zero. This method is useful if you do not wish to - * modify the collection c and thus cannot call - * c.retainAll(retain);. + * modify the collection {@code c} and thus cannot call + * {@code c.retainAll(retain);}. *

    * Moreover this method uses an {@link Equator} instead of * {@link Object#equals(Object)} to determine the equality of the elements - * in collection and retain. Hence this method is + * in {@code collection} and {@code retain}. Hence this method is * useful in cases where the equals behavior of an object needs to be * modified without changing the object itself. *

    @@ -1755,8 +1755,8 @@ public class CollectionUtils { * @param collection the collection whose contents are the target of the {@code retainAll} operation * @param retain the collection containing the elements to be retained in the returned collection * @param equator the Equator used for testing equality - * @return a Collection containing all the elements of collection - * that occur at least once in retain according to the equator + * @return a {@code Collection} containing all the elements of {@code collection} + * that occur at least once in {@code retain} according to the {@code equator} * @throws NullPointerException if any of the parameters is null * @since 4.1 */ @@ -1845,26 +1845,26 @@ public class CollectionUtils { } /** - * Removes the elements in remove from collection. That is, this - * method returns a collection containing all the elements in c - * that are not in remove. The cardinality of an element e - * in the returned collection is the same as the cardinality of e - * in collection unless remove contains e, in which + * Removes the elements in {@code remove} from {@code collection}. That is, this + * method returns a collection containing all the elements in {@code c} + * that are not in {@code remove}. The cardinality of an element {@code e} + * in the returned collection is the same as the cardinality of {@code e} + * in {@code collection} unless {@code remove} contains {@code e}, in which * case the cardinality is zero. This method is useful if you do not wish to modify - * the collection c and thus cannot call collection.removeAll(remove);. + * the collection {@code c} and thus cannot call {@code collection.removeAll(remove);}. *

    - * This implementation iterates over collection, checking each element in - * turn to see if it's contained in remove. If it's not contained, it's added + * This implementation iterates over {@code collection}, checking each element in + * turn to see if it's contained in {@code remove}. If it's not contained, it's added * to the returned list. As a consequence, it is advised to use a collection type for - * remove that provides a fast (e.g. O(1)) implementation of + * {@code remove} that provides a fast (e.g. O(1)) implementation of * {@link Collection#contains(Object)}. *

    * * @param the type of object the {@link Collection} contains * @param collection the collection from which items are removed (in the returned collection) - * @param remove the items to be removed from the returned collection - * @return a Collection containing all the elements of collection except - * any elements that also occur in remove. + * @param remove the items to be removed from the returned {@code collection} + * @return a {@code Collection} containing all the elements of {@code collection} except + * any elements that also occur in {@code remove}. * @throws NullPointerException if either parameter is null * @since 4.0 (method existed in 3.2 but was completely broken) */ @@ -1873,19 +1873,19 @@ public class CollectionUtils { } /** - * Removes all elements in remove from collection. + * Removes all elements in {@code remove} from {@code collection}. * That is, this method returns a collection containing all the elements in - * collection that are not in remove. The - * cardinality of an element e in the returned collection is - * the same as the cardinality of e in collection - * unless remove contains e, in which case the + * {@code collection} that are not in {@code remove}. The + * cardinality of an element {@code e} in the returned collection is + * the same as the cardinality of {@code e} in {@code collection} + * unless {@code remove} contains {@code e}, in which case the * cardinality is zero. This method is useful if you do not wish to modify - * the collection c and thus cannot call - * collection.removeAll(remove). + * the collection {@code c} and thus cannot call + * {@code collection.removeAll(remove)}. *

    * Moreover this method uses an {@link Equator} instead of * {@link Object#equals(Object)} to determine the equality of the elements - * in collection and remove. Hence this method is + * in {@code collection} and {@code remove}. Hence this method is * useful in cases where the equals behavior of an object needs to be * modified without changing the object itself. *

    @@ -1894,8 +1894,8 @@ public class CollectionUtils { * @param collection the collection from which items are removed (in the returned collection) * @param remove the items to be removed from the returned collection * @param equator the Equator used for testing equality - * @return a Collection containing all the elements of collection - * except any element that if equal according to the equator + * @return a {@code Collection} containing all the elements of {@code collection} + * except any element that if equal according to the {@code equator} * @throws NullPointerException if any of the parameters is null * @since 4.1 */ diff --git a/src/main/java/org/apache/commons/collections4/ComparatorUtils.java b/src/main/java/org/apache/commons/collections4/ComparatorUtils.java index c5a374342..14592049e 100644 --- a/src/main/java/org/apache/commons/collections4/ComparatorUtils.java +++ b/src/main/java/org/apache/commons/collections4/ComparatorUtils.java @@ -32,9 +32,9 @@ import org.apache.commons.collections4.comparators.TransformingComparator; * objects. *

    * Most of the functionality in this class can also be found in the - * comparators package. This class merely provides a + * {@code comparators} package. This class merely provides a * convenient central place if you have use for more than one class - * in the comparators subpackage. + * in the {@code comparators} subpackage. *

    * * @since 2.1 @@ -123,9 +123,9 @@ public class ComparatorUtils { * The comparator throws NullPointerException if a null value is compared. *

    * - * @param trueFirst when true, sort - * true {@link Boolean}s before - * false {@link Boolean}s. + * @param trueFirst when {@code true}, sort + * {@code true} {@link Boolean}s before + * {@code false} {@link Boolean}s. * @return a comparator that sorts booleans */ public static Comparator booleanComparator(final boolean trueFirst) { @@ -133,7 +133,7 @@ public class ComparatorUtils { } /** - * Gets a Comparator that controls the comparison of null values. + * Gets a Comparator that controls the comparison of {@code null} values. *

    * The returned comparator will consider a null value to be less than * any nonnull value, and equal to any other null value. Two nonnull @@ -154,7 +154,7 @@ public class ComparatorUtils { } /** - * Gets a Comparator that controls the comparison of null values. + * Gets a Comparator that controls the comparison of {@code null} values. *

    * The returned comparator will consider a null value to be greater than * any nonnull value, and equal to any other null value. Two nonnull diff --git a/src/main/java/org/apache/commons/collections4/EnumerationUtils.java b/src/main/java/org/apache/commons/collections4/EnumerationUtils.java index 9c5fabede..224ab53c3 100644 --- a/src/main/java/org/apache/commons/collections4/EnumerationUtils.java +++ b/src/main/java/org/apache/commons/collections4/EnumerationUtils.java @@ -36,11 +36,11 @@ public class EnumerationUtils { private EnumerationUtils() {} /** - * Returns the index-th value in the {@link Enumeration}, throwing - * IndexOutOfBoundsException if there is no such element. + * Returns the {@code index}-th value in the {@link Enumeration}, throwing + * {@code IndexOutOfBoundsException} if there is no such element. *

    - * The Enumeration is advanced to index (or to the end, if - * index exceeds the number of entries) as a side effect of this method. + * The Enumeration is advanced to {@code index} (or to the end, if + * {@code index} exceeds the number of entries) as a side effect of this method. * * @param e the enumeration to get a value from * @param index the index to get @@ -70,9 +70,9 @@ public class EnumerationUtils { * created. The new list is returned.

    * * @param the element type - * @param enumeration the enumeration to traverse, which should not be null. + * @param enumeration the enumeration to traverse, which should not be {@code null}. * @return a list containing all elements of the given enumeration - * @throws NullPointerException if the enumeration parameter is null. + * @throws NullPointerException if the enumeration parameter is {@code null}. */ public static List toList(final Enumeration enumeration) { return IteratorUtils.toList(new EnumerationIterator<>(enumeration)); diff --git a/src/main/java/org/apache/commons/collections4/Factory.java b/src/main/java/org/apache/commons/collections4/Factory.java index aa53e10a8..38f6fa78f 100644 --- a/src/main/java/org/apache/commons/collections4/Factory.java +++ b/src/main/java/org/apache/commons/collections4/Factory.java @@ -19,7 +19,7 @@ package org.apache.commons.collections4; /** * Defines a functor interface implemented by classes that create objects. *

    - * A Factory creates an object without using an input parameter. + * A {@code Factory} creates an object without using an input parameter. * If an input parameter is required, then {@link Transformer} is more appropriate. *

    *

    diff --git a/src/main/java/org/apache/commons/collections4/FactoryUtils.java b/src/main/java/org/apache/commons/collections4/FactoryUtils.java index b181251c4..b0f3be8ac 100644 --- a/src/main/java/org/apache/commons/collections4/FactoryUtils.java +++ b/src/main/java/org/apache/commons/collections4/FactoryUtils.java @@ -22,7 +22,7 @@ import org.apache.commons.collections4.functors.InstantiateFactory; import org.apache.commons.collections4.functors.PrototypeFactory; /** - * FactoryUtils provides reference implementations and utilities + * {@code FactoryUtils} provides reference implementations and utilities * for the Factory functor interface. The supplied factories are: *

      *
    • Prototype - clones a specified object @@ -83,7 +83,7 @@ public class FactoryUtils { * * @param the type that the factory creates * @param constantToReturn the constant object to return each time in the factory - * @return the constant factory. + * @return the {@code constant} factory. */ public static Factory constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); @@ -104,7 +104,7 @@ public class FactoryUtils { * * @param the type that the factory creates * @param prototype the object to clone each time in the factory - * @return the prototype factory, or a {@link ConstantFactory#NULL_INSTANCE} if + * @return the {@code prototype} factory, or a {@link ConstantFactory#NULL_INSTANCE} if * the {@code prototype} is {@code null} * @throws IllegalArgumentException if the prototype cannot be cloned */ @@ -120,7 +120,7 @@ public class FactoryUtils { * * @param the type that the factory creates * @param classToInstantiate the Class to instantiate each time in the factory - * @return the reflection factory + * @return the {@code reflection} factory * @throws NullPointerException if the classToInstantiate is null */ public static Factory instantiateFactory(final Class classToInstantiate) { @@ -137,7 +137,7 @@ public class FactoryUtils { * @param classToInstantiate the Class to instantiate each time in the factory * @param paramTypes parameter types for the constructor, can be null * @param args the arguments to pass to the constructor, can be null - * @return the reflection factory + * @return the {@code reflection} factory * @throws NullPointerException if the classToInstantiate is null * @throws IllegalArgumentException if the paramTypes and args don't match * @throws IllegalArgumentException if the constructor doesn't exist diff --git a/src/main/java/org/apache/commons/collections4/FluentIterable.java b/src/main/java/org/apache/commons/collections4/FluentIterable.java index 0bf1dbb9f..53f57a991 100644 --- a/src/main/java/org/apache/commons/collections4/FluentIterable.java +++ b/src/main/java/org/apache/commons/collections4/FluentIterable.java @@ -380,7 +380,7 @@ public class FluentIterable implements Iterable { * Checks if all elements contained in this iterable are matching the * provided predicate. *

      - * A null or empty iterable returns true. + * A {@code null} or empty iterable returns true. * * @param predicate the predicate to use, may not be null * @return true if all elements contained in this iterable match the predicate, @@ -394,7 +394,7 @@ public class FluentIterable implements Iterable { /** * Checks if this iterable contains any element matching the provided predicate. *

      - * A null or empty iterable returns false. + * A {@code null} or empty iterable returns false. * * @param predicate the predicate to use, may not be null * @return true if at least one element contained in this iterable matches the predicate, diff --git a/src/main/java/org/apache/commons/collections4/FunctorException.java b/src/main/java/org/apache/commons/collections4/FunctorException.java index a61d47b43..8b8db71e7 100644 --- a/src/main/java/org/apache/commons/collections4/FunctorException.java +++ b/src/main/java/org/apache/commons/collections4/FunctorException.java @@ -28,7 +28,7 @@ public class FunctorException extends RuntimeException { private static final long serialVersionUID = -4704772662059351193L; /** - * Constructs a new FunctorException without specified + * Constructs a new {@code FunctorException} without specified * detail message. */ public FunctorException() { @@ -36,7 +36,7 @@ public class FunctorException extends RuntimeException { } /** - * Constructs a new FunctorException with specified + * Constructs a new {@code FunctorException} with specified * detail message. * * @param msg the error message. @@ -46,8 +46,8 @@ public class FunctorException extends RuntimeException { } /** - * Constructs a new FunctorException with specified - * nested Throwable root cause. + * Constructs a new {@code FunctorException} with specified + * nested {@code Throwable} root cause. * * @param rootCause the exception or error that caused this exception * to be thrown. @@ -57,8 +57,8 @@ public class FunctorException extends RuntimeException { } /** - * Constructs a new FunctorException with specified - * detail message and nested Throwable root cause. + * Constructs a new {@code FunctorException} with specified + * detail message and nested {@code Throwable} root cause. * * @param msg the error message. * @param rootCause the exception or error that caused this exception diff --git a/src/main/java/org/apache/commons/collections4/Get.java b/src/main/java/org/apache/commons/collections4/Get.java index 1892da8e2..5c590e7dd 100644 --- a/src/main/java/org/apache/commons/collections4/Get.java +++ b/src/main/java/org/apache/commons/collections4/Get.java @@ -32,7 +32,7 @@ public interface Get { /** * @param key key whose presence in this map is to be tested - * @return true if this map contains a mapping for the specified + * @return {@code true} if this map contains a mapping for the specified * key * @see java.util.Map#containsKey(Object) */ @@ -40,7 +40,7 @@ public interface Get { /** * @param value value whose presence in this map is to be tested - * @return true if this map maps one or more keys to the + * @return {@code true} if this map maps one or more keys to the * specified value * @see java.util.Map#containsValue(Object) */ @@ -62,14 +62,14 @@ public interface Get { /** * @param key key whose mapping is to be removed from the map - * @return the previous value associated with key, or - * null if there was no mapping for key. + * @return the previous value associated with {@code key}, or + * {@code null} if there was no mapping for {@code key}. * @see java.util.Map#remove(Object) */ V remove(Object key); /** - * @return true if this map contains no key-value mappings + * @return {@code true} if this map contains no key-value mappings * @see java.util.Map#isEmpty() */ boolean isEmpty(); diff --git a/src/main/java/org/apache/commons/collections4/IterableGet.java b/src/main/java/org/apache/commons/collections4/IterableGet.java index e7012fd98..39b7bcab7 100644 --- a/src/main/java/org/apache/commons/collections4/IterableGet.java +++ b/src/main/java/org/apache/commons/collections4/IterableGet.java @@ -27,7 +27,7 @@ package org.apache.commons.collections4; */ public interface IterableGet extends Get { /** - * Obtains a MapIterator over the map. + * Obtains a {@code MapIterator} over the map. *

      * 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. diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java index cce857c29..0e3bcb444 100644 --- a/src/main/java/org/apache/commons/collections4/IterableUtils.java +++ b/src/main/java/org/apache/commons/collections4/IterableUtils.java @@ -599,7 +599,7 @@ public class IterableUtils { /** * Finds the first element in the given iterable which matches the given predicate. *

      - * A null or empty iterator returns null. + * A {@code null} or empty iterator returns null. * * @param the element type * @param iterable the iterable to search, may be null @@ -615,7 +615,7 @@ public class IterableUtils { * Returns the index of the first element in the specified iterable that * matches the given predicate. *

      - * A null or empty iterable returns -1. + * A {@code null} or empty iterable returns -1. * * @param the element type * @param iterable the iterable to search, may be null @@ -630,7 +630,7 @@ public class IterableUtils { /** * Answers true if a predicate is true for every element of an iterable. *

      - * A null or empty iterable returns true. + * A {@code null} or empty iterable returns true. * * @param the type of object the {@link Iterable} contains * @param iterable the {@link Iterable} to use, may be null @@ -646,7 +646,7 @@ public class IterableUtils { /** * Answers true if a predicate is true for any element of the iterable. *

      - * A null or empty iterable returns false. + * A {@code null} or empty iterable returns false. * * @param the type of object the {@link Iterable} contains * @param iterable the {@link Iterable} to use, may be null @@ -661,7 +661,7 @@ public class IterableUtils { /** * Counts the number of elements in the input iterable that match the predicate. *

      - * A null iterable matches no elements. + * A {@code null} iterable matches no elements. * * @param the type of object the {@link Iterable} contains * @param input the {@link Iterable} to get the input from, may be null @@ -677,7 +677,7 @@ public class IterableUtils { /** * Answers true if the provided iterable is empty. *

      - * A null iterable returns true. + * A {@code null} iterable returns true. * * @param iterable the {@link Iterable to use}, may be null * @return true if the iterable is null or empty, false otherwise @@ -692,7 +692,7 @@ public class IterableUtils { /** * Checks if the object is contained in the given iterable. *

      - * A null or empty iterable returns false. + * A {@code null} or empty iterable returns false. * * @param the type of object the {@link Iterable} contains * @param iterable the iterable to check, may be null @@ -711,8 +711,8 @@ public class IterableUtils { * is tested with an {@code equator} unlike {@link #contains(Iterable, Object)} * which uses {@link Object#equals(Object)}. *

      - * A null or empty iterable returns false. - * A null object will not be passed to the equator, instead a + * A {@code null} or empty iterable returns false. + * A {@code null} object will not be passed to the equator, instead a * {@link org.apache.commons.collections4.functors.NullPredicate NullPredicate} * will be used. * @@ -749,8 +749,8 @@ public class IterableUtils { } /** - * Returns the index-th value in the iterable's {@link Iterator}, throwing - * IndexOutOfBoundsException if there is no such element. + * Returns the {@code index}-th value in the {@code iterable}'s {@link Iterator}, throwing + * {@code IndexOutOfBoundsException} if there is no such element. *

      * If the {@link Iterable} is a {@link List}, then it will use {@link List#get(int)}. * @@ -771,8 +771,8 @@ public class IterableUtils { /** * Shortcut for {@code get(iterator, 0)}. *

      - * Returns the first value in the iterable's {@link Iterator}, throwing - * IndexOutOfBoundsException if there is no such element. + * Returns the {@code first} value in the {@code iterable}'s {@link Iterator}, throwing + * {@code IndexOutOfBoundsException} if there is no such element. *

      *

      * If the {@link Iterable} is a {@link List}, then it will use {@link List#get(int)}. @@ -791,7 +791,7 @@ public class IterableUtils { /** * Returns the number of elements contained in the given iterator. *

      - * A null or empty iterator returns {@code 0}. + * A {@code null} or empty iterator returns {@code 0}. * * @param iterable the iterable to check, may be null * @return the number of elements contained in the iterable @@ -818,7 +818,7 @@ public class IterableUtils { * R = collection of elements rejected by all predicates * *

      - * If the input iterable is null, the same is returned as for an + * If the input iterable is {@code null}, the same is returned as for an * empty iterable. *

      * Example: for an input list [1, 2, 3, 4, 5] calling partition with a predicate [x < 3] @@ -860,7 +860,7 @@ public class IterableUtils { * Note: elements are only added to the output collection of the first matching * predicate, determined by the order of arguments. *

      - * If the input iterable is null, the same is returned as for an + * If the input iterable is {@code null}, the same is returned as for an * empty iterable. *

      * Example: for an input list [1, 2, 3, 4, 5] calling partition with predicates [x < 3] @@ -900,7 +900,7 @@ public class IterableUtils { * Note: elements are only added to the output collection of the first matching * predicate, determined by the order of arguments. *

      - * If the input iterable is null, the same is returned as for an + * If the input iterable is {@code null}, the same is returned as for an * empty iterable. * If no predicates have been provided, all elements of the input collection * will be added to the rejected collection. @@ -1069,12 +1069,12 @@ public class IterableUtils { } /** - * Returns an empty iterator if the argument is null, + * Returns an empty iterator if the argument is {@code null}, * or {@code iterable.iterator()} otherwise. * * @param the element type - * @param iterable the iterable, possibly null - * @return an empty iterator if the argument is null + * @param iterable the iterable, possibly {@code null} + * @return an empty iterator if the argument is {@code null} */ private static Iterator emptyIteratorIfNull(final Iterable iterable) { return iterable != null ? iterable.iterator() : IteratorUtils.emptyIterator(); diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java index d22b0e906..29296a9a2 100644 --- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java +++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java @@ -556,9 +556,9 @@ public class IteratorUtils { * Gets an iterator that provides an ordered iteration over the elements * contained in a collection of ordered {@link Iterator}s. *

      - * Given two ordered {@link Iterator}s A and B, + * Given two ordered {@link Iterator}s {@code A} and {@code B}, * the {@link Iterator#next()} method will return the lesser of - * A.next() and B.next(). + * {@code A.next()} and {@code B.next()}. *

      * The comparator is optional. If null is specified then natural order is used. * @@ -582,9 +582,9 @@ public class IteratorUtils { * Gets an iterator that provides an ordered iteration over the elements * contained in an array of {@link Iterator}s. *

      - * Given two ordered {@link Iterator}s A and B, + * Given two ordered {@link Iterator}s {@code A} and {@code B}, * the {@link Iterator#next()} method will return the lesser of - * A.next() and B.next() and so on. + * {@code A.next()} and {@code B.next()} and so on. *

      * The comparator is optional. If null is specified then natural order is used. * @@ -606,9 +606,9 @@ public class IteratorUtils { * Gets an iterator that provides an ordered iteration over the elements * contained in a collection of {@link Iterator}s. *

      - * Given two ordered {@link Iterator}s A and B, + * Given two ordered {@link Iterator}s {@code A} and {@code B}, * the {@link Iterator#next()} method will return the lesser of - * A.next() and B.next() and so on. + * {@code A.next()} and {@code B.next()} and so on. *

      * The comparator is optional. If null is specified then natural order is used. * @@ -634,8 +634,8 @@ public class IteratorUtils { *

      * This iterator can extract multiple objects from a complex tree-like object graph. * The iteration starts from a single root object. - * It uses a Transformer to extract the iterators and elements. - * Its main benefit is that no intermediate List is created. + * It uses a {@code Transformer} to extract the iterators and elements. + * Its main benefit is that no intermediate {@code List} is created. *

      * For example, consider an object graph: *

      @@ -649,7 +649,7 @@ public class IteratorUtils {
            *         |- Tree |         /- Leaf
            *                 |- Branch -- Leaf
            *                 |- Branch -- Leaf
      - * The following Transformer, used in this class, will extract all + * The following {@code Transformer}, used in this class, will extract all * the Leaf objects without creating a combined intermediate list: *
            * public Object transform(Object input) {
      @@ -1207,7 +1207,7 @@ public class IteratorUtils {
           /**
            * Finds the first element in the given iterator which matches the given predicate.
            * 

      - * A null or empty iterator returns null. + * A {@code null} or empty iterator returns null. * * @param the element type * @param iterator the iterator to search, may be null @@ -1234,7 +1234,7 @@ public class IteratorUtils { * Returns the index of the first element in the specified iterator that * matches the given predicate. *

      - * A null or empty iterator returns -1. + * A {@code null} or empty iterator returns -1. * * @param the element type * @param iterator the iterator to search, may be null @@ -1260,7 +1260,7 @@ public class IteratorUtils { /** * Answers true if a predicate is true for any element of the iterator. *

      - * A null or empty iterator returns false. + * A {@code null} or empty iterator returns false. * * @param the type of object the {@link Iterator} contains * @param iterator the {@link Iterator} to use, may be null @@ -1276,7 +1276,7 @@ public class IteratorUtils { /** * Answers true if a predicate is true for every element of an iterator. *

      - * A null or empty iterator returns true. + * A {@code null} or empty iterator returns true. * * @param the type of object the {@link Iterator} contains * @param iterator the {@link Iterator} to use, may be null @@ -1303,7 +1303,7 @@ public class IteratorUtils { /** * Checks if the given iterator is empty. *

      - * A null or empty iterator returns true. + * A {@code null} or empty iterator returns true. * * @param iterator the {@link Iterator} to use, may be null * @return true if the iterator is exhausted or null, false otherwise @@ -1316,7 +1316,7 @@ public class IteratorUtils { /** * Checks if the object is contained in the given iterator. *

      - * A null or empty iterator returns false. + * A {@code null} or empty iterator returns false. * * @param the type of object the {@link Iterator} contains * @param iterator the iterator to check, may be null @@ -1329,11 +1329,11 @@ public class IteratorUtils { } /** - * Returns the index-th value in {@link Iterator}, throwing - * IndexOutOfBoundsException if there is no such element. + * Returns the {@code index}-th value in {@link Iterator}, throwing + * {@code IndexOutOfBoundsException} if there is no such element. *

      - * The Iterator is advanced to index (or to the end, if - * index exceeds the number of entries) as a side effect of this method. + * The Iterator is advanced to {@code index} (or to the end, if + * {@code index} exceeds the number of entries) as a side effect of this method. * * @param the type of object in the {@link Iterator} * @param iterator the iterator to get a value from @@ -1358,12 +1358,12 @@ public class IteratorUtils { /** * Shortcut for {@code get(iterator, 0)}. *

      - * Returns the first value in {@link Iterator}, throwing - * IndexOutOfBoundsException if there is no such element. + * Returns the {@code first} value in {@link Iterator}, throwing + * {@code IndexOutOfBoundsException} if there is no such element. *

      *

      - * The Iterator is advanced to 0 (or to the end, if - * 0 exceeds the number of entries) as a side effect of this method. + * The Iterator is advanced to {@code 0} (or to the end, if + * {@code 0} exceeds the number of entries) as a side effect of this method. *

      * @param the type of object in the {@link Iterator} * @param iterator the iterator to get a value from @@ -1378,7 +1378,7 @@ public class IteratorUtils { /** * Returns the number of elements contained in the given iterator. *

      - * A null or empty iterator returns {@code 0}. + * A {@code null} or empty iterator returns {@code 0}. * * @param iterator the iterator to check, may be null * @return the number of elements contained in the iterator diff --git a/src/main/java/org/apache/commons/collections4/ListUtils.java b/src/main/java/org/apache/commons/collections4/ListUtils.java index 493aefda8..3073e4d2f 100644 --- a/src/main/java/org/apache/commons/collections4/ListUtils.java +++ b/src/main/java/org/apache/commons/collections4/ListUtils.java @@ -44,19 +44,19 @@ import org.apache.commons.collections4.sequence.SequencesComparator; public class ListUtils { /** - * ListUtils should not normally be instantiated. + * {@code ListUtils} should not normally be instantiated. */ private ListUtils() {} //----------------------------------------------------------------------- /** - * Returns an immutable empty list if the argument is null, + * Returns an immutable empty list if the argument is {@code null}, * or the argument itself otherwise. * * @param the element type - * @param list the list, possibly null - * @return an empty list if the argument is null + * @param list the list, possibly {@code null} + * @return an empty list if the argument is {@code null} */ public static List emptyIfNull(final List list) { return list == null ? Collections.emptyList() : list; @@ -69,7 +69,7 @@ public class ListUtils { * @param the element type * @param list the list, possibly {@code null} * @param defaultList the returned values if list is {@code null} - * @return an empty list if the argument is null + * @return an empty list if the argument is {@code null} * @since 4.0 */ public static List defaultIfNull(final List list, final List defaultList) { @@ -170,7 +170,7 @@ public class ListUtils { * Selects all elements from input collection which match the given * predicate into an output list. *

      - * A null predicate matches no elements. + * A {@code null} predicate matches no elements. * * @param the element type * @param inputCollection the collection to get the input from, may not be null @@ -190,7 +190,7 @@ public class ListUtils { * Selects all elements from inputCollection which don't match the given * predicate into an output collection. *

      - * If the input predicate is null, the result is an empty list. + * If the input predicate is {@code null}, the result is an empty list. * * @param the element type * @param inputCollection the collection to get the input from, may not be null @@ -210,7 +210,7 @@ public class ListUtils { * Tests two lists for value-equality as per the equality contract in * {@link java.util.List#equals(java.lang.Object)}. *

      - * This method is useful for implementing List when you cannot + * This method is useful for implementing {@code List} when you cannot * extend AbstractList. The method takes Collection instances to enable other * collection types to use the List implementation algorithm. *

      @@ -264,7 +264,7 @@ public class ListUtils { * Generates a hash code using the algorithm specified in * {@link java.util.List#hashCode()}. *

      - * This method is useful for implementing List when you cannot + * This method is useful for implementing {@code List} when you cannot * extend AbstractList. The method takes Collection instances to enable other * collection types to use the List implementation algorithm. * @@ -288,24 +288,24 @@ public class ListUtils { //----------------------------------------------------------------------- /** - * Returns a List containing all the elements in collection - * that are also in retain. The cardinality of an element e - * in the returned list is the same as the cardinality of e - * in collection unless retain does not contain e, in which + * Returns a List containing all the elements in {@code collection} + * that are also in {@code retain}. The cardinality of an element {@code e} + * in the returned list is the same as the cardinality of {@code e} + * in {@code collection} unless {@code retain} does not contain {@code e}, in which * case the cardinality is zero. This method is useful if you do not wish to modify - * the collection c and thus cannot call collection.retainAll(retain);. + * the collection {@code c} and thus cannot call {@code collection.retainAll(retain);}. *

      - * This implementation iterates over collection, checking each element in - * turn to see if it's contained in retain. If it's contained, it's added + * This implementation iterates over {@code collection}, checking each element in + * turn to see if it's contained in {@code retain}. If it's contained, it's added * to the returned list. As a consequence, it is advised to use a collection type for - * retain that provides a fast (e.g. O(1)) implementation of + * {@code retain} that provides a fast (e.g. O(1)) implementation of * {@link Collection#contains(Object)}. * * @param the element type * @param collection the collection whose contents are the target of the #retailAll operation * @param retain the collection containing the elements to be retained in the returned collection - * @return a List containing all the elements of c - * that occur at least once in retain. + * @return a {@code List} containing all the elements of {@code c} + * that occur at least once in {@code retain}. * @throws NullPointerException if either parameter is null * @since 3.2 */ @@ -321,25 +321,25 @@ public class ListUtils { } /** - * Removes the elements in remove from collection. That is, this - * method returns a list containing all the elements in collection - * that are not in remove. The cardinality of an element e - * in the returned collection is the same as the cardinality of e - * in collection unless remove contains e, in which + * Removes the elements in {@code remove} from {@code collection}. That is, this + * method returns a list containing all the elements in {@code collection} + * that are not in {@code remove}. The cardinality of an element {@code e} + * in the returned collection is the same as the cardinality of {@code e} + * in {@code collection} unless {@code remove} contains {@code e}, in which * case the cardinality is zero. This method is useful if you do not wish to modify - * collection and thus cannot call collection.removeAll(remove);. + * {@code collection} and thus cannot call {@code collection.removeAll(remove);}. *

      - * This implementation iterates over collection, checking each element in - * turn to see if it's contained in remove. If it's not contained, it's added + * This implementation iterates over {@code collection}, checking each element in + * turn to see if it's contained in {@code remove}. If it's not contained, it's added * to the returned list. As a consequence, it is advised to use a collection type for - * remove that provides a fast (e.g. O(1)) implementation of + * {@code remove} that provides a fast (e.g. O(1)) implementation of * {@link Collection#contains(Object)}. * * @param the element type * @param collection the collection from which items are removed (in the returned collection) - * @param remove the items to be removed from the returned collection - * @return a List containing all the elements of c except - * any elements that also occur in remove. + * @param remove the items to be removed from the returned {@code collection} + * @return a {@code List} containing all the elements of {@code c} except + * any elements that also occur in {@code remove}. * @throws NullPointerException if either parameter is null * @since 3.2 */ @@ -457,10 +457,10 @@ public class ListUtils { * Date date = lazy.get(3); *

      * - * After the above code is executed, date will refer to - * a new Date instance. Furthermore, that Date + * After the above code is executed, {@code date} will refer to + * a new {@code Date} instance. Furthermore, that {@code Date} * instance is the fourth element in the list. The first, second, - * and third element are all set to null. + * and third element are all set to {@code null}. * * @param the element type * @param list the list to make lazy, must not be null @@ -488,10 +488,10 @@ public class ListUtils { * Date date = lazy.get(3); * * - * After the above code is executed, date will refer to - * a new Date instance. Furthermore, that Date + * After the above code is executed, {@code date} will refer to + * a new {@code Date} instance. Furthermore, that {@code Date} * instance is the fourth element in the list. The first, second, - * and third element are all set to null. + * and third element are all set to {@code null}. * * @param the element type * @param list the list to make lazy, must not be null diff --git a/src/main/java/org/apache/commons/collections4/MapIterator.java b/src/main/java/org/apache/commons/collections4/MapIterator.java index bc9115865..7a86a5dc8 100644 --- a/src/main/java/org/apache/commons/collections4/MapIterator.java +++ b/src/main/java/org/apache/commons/collections4/MapIterator.java @@ -19,7 +19,7 @@ package org.apache.commons.collections4; import java.util.Iterator; /** - * Defines an iterator that operates over a Map. + * Defines an iterator that operates over a {@code Map}. *

      * 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 @@ -31,8 +31,8 @@ import java.util.Iterator; *

      *

      * In use, this iterator iterates through the keys in the map. After each call - * to next(), the getValue() method provides direct - * access to the value. The value can also be set using setValue(). + * to {@code next()}, the {@code getValue()} method provides direct + * access to the value. The value can also be set using {@code setValue()}. *

      *
      {@code
        * MapIterator it = map.mapIterator();
      @@ -52,13 +52,13 @@ public interface MapIterator extends Iterator {
           /**
            * Checks to see if there are more entries still to be iterated.
            *
      -     * @return true if the iterator has more elements
      +     * @return {@code true} if the iterator has more elements
            */
           @Override
           boolean hasNext();
       
           /**
      -     * Gets the next key from the Map.
      +     * Gets the next key from the {@code Map}.
            *
            * @return the next key in the iteration
            * @throws java.util.NoSuchElementException if the iteration is finished
      @@ -69,32 +69,32 @@ public interface MapIterator extends Iterator {
           //-----------------------------------------------------------------------
           /**
            * Gets the current key, which is the key returned by the last call
      -     * to next().
      +     * to {@code next()}.
            *
            * @return the current key
      -     * @throws IllegalStateException if next() has not yet been called
      +     * @throws IllegalStateException if {@code next()} has not yet been called
            */
           K getKey();
       
           /**
            * Gets the current value, which is the value associated with the last key
      -     * returned by next().
      +     * returned by {@code next()}.
            *
            * @return the current value
      -     * @throws IllegalStateException if next() has not yet been called
      +     * @throws IllegalStateException if {@code next()} has not yet been called
            */
           V getValue();
       
           //-----------------------------------------------------------------------
           /**
      -     * Removes the last returned key from the underlying Map (optional operation).
      +     * Removes the last returned key from the underlying {@code Map} (optional operation).
            * 

      - * This method can be called once per call to next(). + * This method can be called once per call to {@code next()}. * * @throws UnsupportedOperationException if remove is not supported by the map - * @throws IllegalStateException if next() has not yet been called - * @throws IllegalStateException if remove() has already been called - * since the last call to next() + * @throws IllegalStateException if {@code next()} has not yet been called + * @throws IllegalStateException if {@code remove()} has already been called + * since the last call to {@code next()} */ @Override void remove(); @@ -105,9 +105,9 @@ public interface MapIterator extends Iterator { * @param value the new value * @return the previous value * @throws UnsupportedOperationException if setValue is not supported by the map - * @throws IllegalStateException if next() has not yet been called - * @throws IllegalStateException if remove() has been called since the - * last call to next() + * @throws IllegalStateException if {@code next()} has not yet been called + * @throws IllegalStateException if {@code remove()} has been called since the + * last call to {@code next()} */ V setValue(V value); diff --git a/src/main/java/org/apache/commons/collections4/MapUtils.java b/src/main/java/org/apache/commons/collections4/MapUtils.java index 2570d2023..b89c404d3 100644 --- a/src/main/java/org/apache/commons/collections4/MapUtils.java +++ b/src/main/java/org/apache/commons/collections4/MapUtils.java @@ -161,22 +161,22 @@ public class MapUtils { *

      * * @param out the stream to print to, must not be null - * @param label The label to be used, may be null. If null, the label is not output. It + * @param label The label to be used, may be {@code null}. If {@code null}, the label is not output. It * typically represents the name of the property in a bean or similar. - * @param map The map to print, may be null. If null, the text 'null' is output. - * @throws NullPointerException if the stream is null + * @param map The map to print, may be {@code null}. If {@code null}, the text 'null' is output. + * @throws NullPointerException if the stream is {@code null} */ public static void debugPrint(final PrintStream out, final Object label, final Map map) { verbosePrintInternal(out, label, map, new ArrayDeque>(), true); } /** - * Returns an immutable empty map if the argument is null, or the argument itself otherwise. + * Returns an immutable empty map if the argument is {@code null}, or the argument itself otherwise. * * @param the key type * @param the value type - * @param map the map, possibly null - * @return an empty map if the argument is null + * @param map the map, possibly {@code null} + * @return an empty map if the argument is {@code null} */ public static Map emptyIfNull(final Map map) { return map == null ? Collections.emptyMap() : map; @@ -213,15 +213,15 @@ public class MapUtils { /** * Gets a Boolean from a Map in a null-safe manner. *

      - * If the value is a Boolean it is returned directly. If the value is a String and it - * equals 'true' ignoring case then true is returned, otherwise false. If the value is a - * Number an integer zero value returns false and non-zero returns true. - * Otherwise, null is returned. + * If the value is a {@code Boolean} it is returned directly. If the value is a {@code String} and it + * equals 'true' ignoring case then {@code true} is returned, otherwise {@code false}. If the value is a + * {@code Number} an integer zero value returns {@code false} and non-zero returns {@code true}. + * Otherwise, {@code null} is returned. * * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a Boolean, null if null map input + * @return the value in the Map as a Boolean, {@code null} if null map input */ public static Boolean getBoolean(final Map map, final K key) { if (map != null) { @@ -279,16 +279,16 @@ public class MapUtils { /** * Gets a boolean from a Map in a null-safe manner. *

      - * If the value is a Boolean its value is returned. If the value is a String and it equals - * 'true' ignoring case then true is returned, otherwise false. If the value is a - * Number an integer zero value returns false and non-zero returns true. - * Otherwise, false is returned. + * If the value is a {@code Boolean} its value is returned. If the value is a {@code String} and it equals + * 'true' ignoring case then {@code true} is returned, otherwise {@code false}. If the value is a + * {@code Number} an integer zero value returns {@code false} and non-zero returns {@code true}. + * Otherwise, {@code false} is returned. *

      * * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a Boolean, false if null map input + * @return the value in the Map as a Boolean, {@code false} if null map input */ public static boolean getBooleanValue(final Map map, final K key) { return Boolean.TRUE.equals(getBoolean(map, key)); @@ -299,17 +299,17 @@ public class MapUtils { /** * Gets a boolean from a Map in a null-safe manner, using the default value if the conversion fails. *

      - * If the value is a Boolean its value is returned. If the value is a String and it equals - * 'true' ignoring case then true is returned, otherwise false. If the value is a - * Number an integer zero value returns false and non-zero returns true. - * Otherwise, defaultValue is returned. + * If the value is a {@code Boolean} its value is returned. If the value is a {@code String} and it equals + * 'true' ignoring case then {@code true} is returned, otherwise {@code false}. If the value is a + * {@code Number} an integer zero value returns {@code false} and non-zero returns {@code true}. + * Otherwise, {@code defaultValue} is returned. *

      * * @param the key type * @param map the map to use * @param key the key to look up * @param defaultValue return if the value is null or if the conversion fails - * @return the value in the Map as a Boolean, defaultValue if null map input + * @return the value in the Map as a Boolean, {@code defaultValue} if null map input */ public static boolean getBooleanValue(final Map map, final K key, final boolean defaultValue) { return applyDefaultValue(map, key, MapUtils::getBoolean, defaultValue).booleanValue(); @@ -319,17 +319,17 @@ public class MapUtils { * Gets a boolean from a Map in a null-safe manner, using the default value produced by the defaultFunction if the * conversion fails. *

      - * If the value is a Boolean its value is returned. If the value is a String and it equals - * 'true' ignoring case then true is returned, otherwise false. If the value is a - * Number an integer zero value returns false and non-zero returns true. - * Otherwise, defaultValue produced by the defaultFunction is returned. + * If the value is a {@code Boolean} its value is returned. If the value is a {@code String} and it equals + * 'true' ignoring case then {@code true} is returned, otherwise {@code false}. If the value is a + * {@code Number} an integer zero value returns {@code false} and non-zero returns {@code true}. + * Otherwise, defaultValue produced by the {@code defaultFunction} is returned. *

      * * @param the key type * @param map the map to use * @param key the key to look up * @param defaultFunction produce the default value to return if the value is null or if the conversion fails - * @return the value in the Map as a Boolean, default value produced by the defaultFunction if null map + * @return the value in the Map as a Boolean, default value produced by the {@code defaultFunction} if null map * input * @since 4.5 */ @@ -347,7 +347,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a Byte, null if null map input + * @return the value in the Map as a Byte, {@code null} if null map input */ public static Byte getByte(final Map map, final K key) { final Number answer = getNumber(map, key); @@ -400,7 +400,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a byte, 0 if null map input + * @return the value in the Map as a byte, {@code 0} if null map input */ public static byte getByteValue(final Map map, final K key) { return applyDefaultValue(map, key, MapUtils::getByte, 0).byteValue(); @@ -416,7 +416,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultValue return if the value is null or if the conversion fails - * @return the value in the Map as a byte, defaultValue if null map input + * @return the value in the Map as a byte, {@code defaultValue} if null map input */ public static byte getByteValue(final Map map, final K key, final byte defaultValue) { return applyDefaultValue(map, key, MapUtils::getByte, defaultValue).byteValue(); @@ -433,7 +433,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultFunction produce the default value to return if the value is null or if the conversion fails - * @return the value in the Map as a byte, default value produced by the defaultFunction if null map + * @return the value in the Map as a byte, default value produced by the {@code defaultFunction} if null map * input * @since 4.5 */ @@ -451,7 +451,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a Double, null if null map input + * @return the value in the Map as a Double, {@code null} if null map input */ public static Double getDouble(final Map map, final K key) { final Number answer = getNumber(map, key); @@ -505,7 +505,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a double, 0.0 if null map input + * @return the value in the Map as a double, {@code 0.0} if null map input */ public static double getDoubleValue(final Map map, final K key) { return applyDefaultValue(map, key, MapUtils::getDouble, 0d).doubleValue(); @@ -521,7 +521,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultValue return if the value is null or if the conversion fails - * @return the value in the Map as a double, defaultValue if null map input + * @return the value in the Map as a double, {@code defaultValue} if null map input */ public static double getDoubleValue(final Map map, final K key, final double defaultValue) { return applyDefaultValue(map, key, MapUtils::getDouble, defaultValue).doubleValue(); @@ -538,7 +538,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultFunction produce the default value to return if the value is null or if the conversion fails - * @return the value in the Map as a double, default value produced by the defaultFunction if null map + * @return the value in the Map as a double, default value produced by the {@code defaultFunction} if null map * input * @since 4.5 */ @@ -556,7 +556,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a Float, null if null map input + * @return the value in the Map as a Float, {@code null} if null map input */ public static Float getFloat(final Map map, final K key) { final Number answer = getNumber(map, key); @@ -610,7 +610,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a float, 0.0F if null map input + * @return the value in the Map as a float, {@code 0.0F} if null map input */ public static float getFloatValue(final Map map, final K key) { return applyDefaultValue(map, key, MapUtils::getFloat, 0f).floatValue(); @@ -626,7 +626,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultValue return if the value is null or if the conversion fails - * @return the value in the Map as a float, defaultValue if null map input + * @return the value in the Map as a float, {@code defaultValue} if null map input */ public static float getFloatValue(final Map map, final K key, final float defaultValue) { return applyDefaultValue(map, key, MapUtils::getFloat, defaultValue).floatValue(); @@ -643,7 +643,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultFunction produce the default value to return if the value is null or if the conversion fails - * @return the value in the Map as a float, default value produced by the defaultFunction if null map + * @return the value in the Map as a float, default value produced by the {@code defaultFunction} if null map * input * @since 4.5 */ @@ -661,7 +661,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a Integer, null if null map input + * @return the value in the Map as a Integer, {@code null} if null map input */ public static Integer getInteger(final Map map, final K key) { final Number answer = getNumber(map, key); @@ -715,7 +715,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as an int, 0 if null map input + * @return the value in the Map as an int, {@code 0} if null map input */ public static int getIntValue(final Map map, final K key) { return applyDefaultValue(map, key, MapUtils::getInteger, 0).intValue(); @@ -732,7 +732,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultFunction produce the default value to return if the value is null or if the conversion fails - * @return the value in the Map as an int, default value produced by the defaultFunction if null map + * @return the value in the Map as an int, default value produced by the {@code defaultFunction} if null map * input * @since 4.5 */ @@ -751,7 +751,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultValue return if the value is null or if the conversion fails - * @return the value in the Map as an int, defaultValue if null map input + * @return the value in the Map as an int, {@code defaultValue} if null map input */ public static int getIntValue(final Map map, final K key, final int defaultValue) { return applyDefaultValue(map, key, MapUtils::getInteger, defaultValue).intValue(); @@ -766,7 +766,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a Long, null if null map input + * @return the value in the Map as a Long, {@code null} if null map input */ public static Long getLong(final Map map, final K key) { final Number answer = getNumber(map, key); @@ -819,7 +819,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a long, 0L if null map input + * @return the value in the Map as a long, {@code 0L} if null map input */ public static long getLongValue(final Map map, final K key) { return applyDefaultValue(map, key, MapUtils::getLong, 0L).longValue(); @@ -836,7 +836,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultFunction produce the default value to return if the value is null or if the conversion fails - * @return the value in the Map as a long, default value produced by the defaultFunction if null map + * @return the value in the Map as a long, default value produced by the {@code defaultFunction} if null map * input * @since 4.5 */ @@ -855,7 +855,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultValue return if the value is null or if the conversion fails - * @return the value in the Map as a long, defaultValue if null map input + * @return the value in the Map as a long, {@code defaultValue} if null map input */ public static long getLongValue(final Map map, final K key, final long defaultValue) { return applyDefaultValue(map, key, MapUtils::getLong, defaultValue).longValue(); @@ -864,13 +864,13 @@ public class MapUtils { /** * Gets a Map from a Map in a null-safe manner. *

      - * If the value returned from the specified map is not a Map then null is returned. + * If the value returned from the specified map is not a Map then {@code null} is returned. *

      * * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a Map, null if null map input + * @return the value in the Map as a Map, {@code null} if null map input */ public static Map getMap(final Map map, final K key) { if (map != null) { @@ -917,15 +917,15 @@ public class MapUtils { /** * Gets a Number from a Map in a null-safe manner. *

      - * If the value is a Number it is returned directly. If the value is a String it is - * converted using {@link NumberFormat#parse(String)} on the system default formatter returning null if - * the conversion fails. Otherwise, null is returned. + * If the value is a {@code Number} it is returned directly. If the value is a {@code String} it is + * converted using {@link NumberFormat#parse(String)} on the system default formatter returning {@code null} if + * the conversion fails. Otherwise, {@code null} is returned. *

      * * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a Number, null if null map input + * @return the value in the Map as a Number, {@code null} if null map input */ public static Number getNumber(final Map map, final K key) { if (map != null) { @@ -987,7 +987,7 @@ public class MapUtils { * @param the value type * @param map the map to use * @param key the key to look up - * @return the value in the Map, null if null map input + * @return the value in the Map, {@code null} if null map input */ public static V getObject(final Map map, final K key) { if (map != null) { @@ -1026,7 +1026,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a Short, null if null map input + * @return the value in the Map as a Short, {@code null} if null map input */ public static Short getShort(final Map map, final K key) { final Number answer = getNumber(map, key); @@ -1080,7 +1080,7 @@ public class MapUtils { * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a short, 0 if null map input + * @return the value in the Map as a short, {@code 0} if null map input */ public static short getShortValue(final Map map, final K key) { return applyDefaultValue(map, key, MapUtils::getShort, 0).shortValue(); @@ -1097,7 +1097,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultFunction produce the default value to return if the value is null or if the conversion fails - * @return the value in the Map as a short, default value produced by the defaultFunction if null map + * @return the value in the Map as a short, default value produced by the {@code defaultFunction} if null map * input * @since 4.5 */ @@ -1116,7 +1116,7 @@ public class MapUtils { * @param map the map to use * @param key the key to look up * @param defaultValue return if the value is null or if the conversion fails - * @return the value in the Map as a short, defaultValue if null map input + * @return the value in the Map as a short, {@code defaultValue} if null map input */ public static short getShortValue(final Map map, final K key, final short defaultValue) { return applyDefaultValue(map, key, MapUtils::getShort, defaultValue).shortValue(); @@ -1125,13 +1125,13 @@ public class MapUtils { /** * Gets a String from a Map in a null-safe manner. *

      - * The String is obtained via toString. + * The String is obtained via {@code toString}. *

      * * @param the key type * @param map the map to use * @param key the key to look up - * @return the value in the Map as a String, null if null map input + * @return the value in the Map as a String, {@code null} if null map input */ public static String getString(final Map map, final K key) { if (map != null) { @@ -1282,8 +1282,8 @@ public class MapUtils { *
      * *

      - * After the above code is executed, obj will contain a new Date instance. Furthermore, - * that Date instance is the value for the "test" key in the map. + * After the above code is executed, {@code obj} will contain a new {@code Date} instance. Furthermore, + * that {@code Date} instance is the value for the {@code "test"} key in the map. *

      * * @param the key type @@ -1320,8 +1320,8 @@ public class MapUtils { * * *

      - * After the above code is executed, obj will contain a new File instance for the C drive - * dev directory. Furthermore, that File instance is the value for the "C:/dev" key in the + * After the above code is executed, {@code obj} will contain a new {@code File} instance for the C drive + * dev directory. Furthermore, that {@code File} instance is the value for the {@code "C:/dev"} key in the * map. *

      *

      @@ -1361,8 +1361,8 @@ public class MapUtils { * Object obj = lazy.get("test"); * *

      - * After the above code is executed, obj will contain a new Date instance. Furthermore, - * that Date instance is the value for the "test" key. + * After the above code is executed, {@code obj} will contain a new {@code Date} instance. Furthermore, + * that {@code Date} instance is the value for the {@code "test"} key. *

      * * @param the key type @@ -1396,8 +1396,8 @@ public class MapUtils { * Object obj = lazy.get("C:/dev"); * *

      - * After the above code is executed, obj will contain a new File instance for the C drive - * dev directory. Furthermore, that File instance is the value for the "C:/dev" key in the + * After the above code is executed, {@code obj} will contain a new {@code File} instance for the C drive + * dev directory. Furthermore, that {@code File} instance is the value for the {@code "C:/dev"} key in the * map. *

      *

      @@ -1493,15 +1493,15 @@ public class MapUtils { } /** - * Populates a Map using the supplied Transformers to transform the elements into keys and values. + * Populates a Map using the supplied {@code Transformer}s to transform the elements into keys and values. * * @param the key type * @param the value type * @param the type of object contained in the {@link Iterable} - * @param map the Map to populate. - * @param elements the Iterable containing the input values for the map. - * @param keyTransformer the Transformer used to transform the element into a key value - * @param valueTransformer the Transformer used to transform the element into a value + * @param map the {@code Map} to populate. + * @param elements the {@code Iterable} containing the input values for the map. + * @param keyTransformer the {@code Transformer} used to transform the element into a key value + * @param valueTransformer the {@code Transformer} used to transform the element into a value * @throws NullPointerException if the map, elements or transformers are null */ public static void populateMap(final Map map, final Iterable elements, @@ -1514,14 +1514,14 @@ public class MapUtils { } /** - * Populates a Map using the supplied Transformer to transform the elements into keys, using the - * unaltered element as the value in the Map. + * Populates a Map using the supplied {@code Transformer} to transform the elements into keys, using the + * unaltered element as the value in the {@code Map}. * * @param the key type * @param the value type - * @param map the Map to populate. - * @param elements the Iterable containing the input values for the map. - * @param keyTransformer the Transformer used to transform the element into a key value + * @param map the {@code Map} to populate. + * @param elements the {@code Iterable} containing the input values for the map. + * @param keyTransformer the {@code Transformer} used to transform the element into a key value * @throws NullPointerException if the map, elements or transformer are null */ public static void populateMap(final Map map, final Iterable elements, @@ -1530,15 +1530,15 @@ public class MapUtils { } /** - * Populates a MultiMap using the supplied Transformers to transform the elements into keys and values. + * Populates a MultiMap using the supplied {@code Transformer}s to transform the elements into keys and values. * * @param the key type * @param the value type * @param the type of object contained in the {@link Iterable} - * @param map the MultiMap to populate. - * @param elements the Iterable containing the input values for the map. - * @param keyTransformer the Transformer used to transform the element into a key value - * @param valueTransformer the Transformer used to transform the element into a value + * @param map the {@code MultiMap} to populate. + * @param elements the {@code Iterable} containing the input values for the map. + * @param keyTransformer the {@code Transformer} used to transform the element into a key value + * @param valueTransformer the {@code Transformer} used to transform the element into a value * @throws NullPointerException if the map, collection or transformers are null */ public static void populateMap(final MultiMap map, final Iterable elements, @@ -1551,14 +1551,14 @@ public class MapUtils { } /** - * Populates a MultiMap using the supplied Transformer to transform the elements into keys, using the - * unaltered element as the value in the MultiMap. + * Populates a MultiMap using the supplied {@code Transformer} to transform the elements into keys, using the + * unaltered element as the value in the {@code MultiMap}. * * @param the key type * @param the value type - * @param map the MultiMap to populate. - * @param elements the Iterable to use as input values for the map. - * @param keyTransformer the Transformer used to transform the element into a key value + * @param map the {@code MultiMap} to populate. + * @param elements the {@code Iterable} to use as input values for the map. + * @param keyTransformer the {@code Transformer} used to transform the element into a key value * @throws NullPointerException if the map, elements or transformer are null */ public static void populateMap(final MultiMap map, final Iterable elements, @@ -1957,10 +1957,10 @@ public class MapUtils { *

      * * @param out the stream to print to, must not be null - * @param label The label to be used, may be null. If null, the label is not output. It + * @param label The label to be used, may be {@code null}. If {@code null}, the label is not output. It * typically represents the name of the property in a bean or similar. - * @param map The map to print, may be null. If null, the text 'null' is output. - * @throws NullPointerException if the stream is null + * @param map The map to print, may be {@code null}. If {@code null}, the text 'null' is output. + * @throws NullPointerException if the stream is {@code null} */ public static void verbosePrint(final PrintStream out, final Object label, final Map map) { verbosePrintInternal(out, label, map, new ArrayDeque>(), false); @@ -1975,13 +1975,13 @@ public class MapUtils { * grandfather, great-grandfather, etc). * * @param out the stream to print to - * @param label the label to be used, may be null. If null, the label is not output. It + * @param label the label to be used, may be {@code null}. If {@code null}, the label is not output. It * typically represents the name of the property in a bean or similar. - * @param map the map to print, may be null. If null, the text 'null' is output + * @param map the map to print, may be {@code null}. If {@code null}, the text 'null' is output * @param lineage a stack consisting of any maps in which the previous argument is contained. This is checked to * avoid infinite recursion when printing the output * @param debug flag indicating whether type names should be output. - * @throws NullPointerException if the stream is null + * @throws NullPointerException if the stream is {@code null} */ private static void verbosePrintInternal(final PrintStream out, final Object label, final Map map, final Deque> lineage, final boolean debug) { @@ -2040,7 +2040,7 @@ public class MapUtils { } /** - * MapUtils should not normally be instantiated. + * {@code MapUtils} should not normally be instantiated. */ private MapUtils() { } diff --git a/src/main/java/org/apache/commons/collections4/MultiMap.java b/src/main/java/org/apache/commons/collections4/MultiMap.java index 6b238c033..dfdbe14e1 100644 --- a/src/main/java/org/apache/commons/collections4/MultiMap.java +++ b/src/main/java/org/apache/commons/collections4/MultiMap.java @@ -21,7 +21,7 @@ import java.util.Collection; /** * Defines a map that holds a collection of values against each key. *

      - * A MultiMap is a Map with slightly different semantics. + * A {@code MultiMap} 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. *

      @@ -35,12 +35,12 @@ import java.util.Collection; * mhm.put(key, "C"); * Collection coll = (Collection) mhm.get(key); *

      - * coll will be a collection containing "A", "B", "C". + * {@code coll} will be a collection containing "A", "B", "C". *

      *

      * 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 Map anyway. + * as they were defined in the superinterface {@code Map} anyway. *

      * * @param the type of the keys in this map @@ -59,7 +59,7 @@ public interface MultiMap extends IterableMap { * Other values attached to that key are unaffected. *

      * If the last value for a key is removed, implementations typically - * return null from a subsequent get(Object), however + * return {@code null} from a subsequent {@code get(Object)}, however * they may choose to return an empty collection. * * @param key the key to remove from @@ -87,19 +87,19 @@ public interface MultiMap extends IterableMap { /** * Gets the collection of values associated with the specified key. *

      - * The returned value will implement Collection. Implementations - * are free to declare that they return Collection subclasses - * such as List or Set. + * The returned value will implement {@code Collection}. Implementations + * are free to declare that they return {@code Collection} subclasses + * such as {@code List} or {@code Set}. *

      - * Implementations typically return null if no values have + * Implementations typically return {@code null} if no values have * been mapped to the key, however the implementation may choose to * return an empty collection. *

      * Implementations may choose to return a clone of the internal collection. * * @param key the key to retrieve - * @return the Collection of values, implementations should - * return null for no mapping, but may return an empty collection + * @return the {@code Collection} of values, implementations should + * return {@code null} for no mapping, but may return an empty collection * @throws ClassCastException if the key is of an invalid type * @throws NullPointerException if the key is null and null keys are invalid */ @@ -123,9 +123,9 @@ public interface MultiMap extends IterableMap { /** * Adds the value to the collection associated with the specified key. *

      - * Unlike a normal Map the previous value is not replaced. + * Unlike a normal {@code Map} the previous value is not replaced. * Instead the new value is added to the collection stored against the key. - * The collection may be a List, Set or other + * The collection may be a {@code List}, {@code Set} or other * collection dependent on implementation. * * @param key the key to store against @@ -142,12 +142,12 @@ public interface MultiMap extends IterableMap { /** * Removes all values associated with the specified key. *

      - * Implementations typically return null from a subsequent - * get(Object), however they may choose to return an empty collection. + * Implementations typically return {@code null} from a subsequent + * {@code get(Object)}, however they may choose to return an empty collection. * * @param key the key to remove values from - * @return the Collection of values removed, implementations should - * return null for no mapping found, but may return an empty collection + * @return the {@code Collection} of values removed, implementations should + * return {@code null} for no mapping found, but may return an empty collection * @throws UnsupportedOperationException if the map is unmodifiable * @throws ClassCastException if the key is of an invalid type * @throws NullPointerException if the key is null and null keys are invalid diff --git a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java index f8705177b..9c695354a 100644 --- a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java +++ b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java @@ -44,7 +44,7 @@ import org.apache.commons.collections4.multimap.UnmodifiableMultiValuedMap; public class MultiMapUtils { /** - * MultiMapUtils should not normally be instantiated. + * {@code MultiMapUtils} should not normally be instantiated. */ private MultiMapUtils() {} @@ -60,7 +60,7 @@ public class MultiMapUtils { * * @param the type of key in the map * @param the type of value in the map - * @return immutable and empty MultiValuedMap + * @return immutable and empty {@code MultiValuedMap} */ @SuppressWarnings("unchecked") public static MultiValuedMap emptyMultiValuedMap() { @@ -70,8 +70,8 @@ public class MultiMapUtils { // Null safe methods /** - * Returns an immutable empty MultiValuedMap if the argument is - * null, or the argument itself otherwise. + * Returns an immutable empty {@code MultiValuedMap} if the argument is + * {@code null}, or the argument itself otherwise. * * @param the type of key in the map * @param the type of value in the map @@ -84,7 +84,7 @@ public class MultiMapUtils { } /** - * Null-safe check if the specified MultiValuedMap is empty. + * Null-safe check if the specified {@code MultiValuedMap} is empty. *

      * If the provided map is null, returns true. * @@ -99,7 +99,7 @@ public class MultiMapUtils { // ------------------------------------------------------------------------- /** - * Gets a Collection from MultiValuedMap in a null-safe manner. + * Gets a Collection from {@code MultiValuedMap} in a null-safe manner. * * @param the key type * @param the value type @@ -118,7 +118,7 @@ public class MultiMapUtils { // to the returned collection might update the backing map. This should be clarified and/or prevented. /** - * Gets a List from MultiValuedMap in a null-safe manner. + * Gets a List from {@code MultiValuedMap} in a null-safe manner. * * @param the key type * @param the value type @@ -138,7 +138,7 @@ public class MultiMapUtils { } /** - * Gets a Set from MultiValuedMap in a null-safe manner. + * Gets a Set from {@code MultiValuedMap} in a null-safe manner. * * @param the key type * @param the value type @@ -158,7 +158,7 @@ public class MultiMapUtils { } /** - * Gets a Bag from MultiValuedMap in a null-safe manner. + * Gets a Bag from {@code MultiValuedMap} in a null-safe manner. * * @param the key type * @param the value type @@ -186,7 +186,7 @@ public class MultiMapUtils { * * @param the key type * @param the value type - * @return a new ListValuedMap + * @return a new {@code ListValuedMap} */ public static ListValuedMap newListValuedHashMap() { return new ArrayListValuedHashMap<>(); @@ -208,7 +208,7 @@ public class MultiMapUtils { // ----------------------------------------------------------------------- /** - * Returns an UnmodifiableMultiValuedMap backed by the given + * Returns an {@code UnmodifiableMultiValuedMap} backed by the given * map. * * @param the key type @@ -223,9 +223,9 @@ public class MultiMapUtils { } /** - * Returns a TransformedMultiValuedMap backed by the given map. + * Returns a {@code TransformedMultiValuedMap} backed by the given map. *

      - * This method returns a new MultiValuedMap (decorating the + * This method returns a new {@code MultiValuedMap} (decorating the * specified map) that will transform any new entries added to it. Existing * entries in the specified map will not be transformed. If you want that * behaviour, see {@link TransformedMultiValuedMap#transformedMap}. @@ -242,7 +242,7 @@ public class MultiMapUtils { * @param map the {@link MultiValuedMap} to transform, must not be null, typically empty * @param keyTransformer the transformer for the map keys, null means no transformation * @param valueTransformer the transformer for the map values, null means no transformation - * @return a transformed MultiValuedMap backed by the given map + * @return a transformed {@code MultiValuedMap} backed by the given map * @throws NullPointerException if map is null */ public static MultiValuedMap transformedMultiValuedMap(final MultiValuedMap map, diff --git a/src/main/java/org/apache/commons/collections4/MultiSet.java b/src/main/java/org/apache/commons/collections4/MultiSet.java index 4edffc1f1..bbf9f2d4a 100644 --- a/src/main/java/org/apache/commons/collections4/MultiSet.java +++ b/src/main/java/org/apache/commons/collections4/MultiSet.java @@ -24,9 +24,9 @@ import java.util.Set; * Defines a collection that counts the number of times an object appears in * the collection. *

      - * Suppose you have a MultiSet that contains {a, a, b, c}. - * Calling {@link #getCount(Object)} on a would return 2, while - * calling {@link #uniqueSet()} would return {a, b, c}. + * Suppose you have a MultiSet that contains {@code {a, a, b, c}}. + * Calling {@link #getCount(Object)} on {@code a} would return 2, while + * calling {@link #uniqueSet()} would return {@code {a, b, c}}. *

      * * @param the type held in the multiset @@ -67,7 +67,7 @@ public interface MultiSet extends Collection { * {@link #uniqueSet()} and report its count as 1. * * @param object the object to add - * @return true always, as the size of the MultiSet is increased + * @return {@code true} always, as the size of the MultiSet is increased * in any case */ @Override @@ -78,7 +78,7 @@ public interface MultiSet extends Collection { *

      * If the object is already in the {@link #uniqueSet()} then increment its * count as reported by {@link #getCount(Object)}. Otherwise add it to the - * {@link #uniqueSet()} and report its count as occurrences. + * {@link #uniqueSet()} and report its count as {@code occurrences}. * * @param object the object to add * @param occurrences the number of occurrences to add, may be zero, @@ -96,7 +96,7 @@ public interface MultiSet extends Collection { * to zero, the object will be removed from the {@link #uniqueSet()}. * * @param object the object to remove - * @return true if this call changed the collection + * @return {@code true} if this call changed the collection */ @Override boolean remove(Object object); @@ -159,11 +159,11 @@ public interface MultiSet extends Collection { int size(); /** - * Returns true if the MultiSet contains at least one + * Returns {@code true} if the MultiSet contains at least one * occurrence for each element contained in the given collection. * * @param coll the collection to check against - * @return true if the MultiSet contains all the collection + * @return {@code true} if the MultiSet contains all the collection */ @Override boolean containsAll(Collection coll); @@ -173,7 +173,7 @@ public interface MultiSet extends Collection { * in the given collection. * * @param coll the collection of elements to remove - * @return true if this call changed the multiset + * @return {@code true} if this call changed the multiset */ @Override boolean removeAll(Collection coll); @@ -183,7 +183,7 @@ public interface MultiSet extends Collection { * given collection. * * @param coll the collection of elements to retain - * @return true if this call changed the multiset + * @return {@code true} if this call changed the multiset */ @Override boolean retainAll(Collection coll); @@ -204,7 +204,7 @@ public interface MultiSet extends Collection { * Gets a hash code for the MultiSet compatible with the definition of equals. * The hash code is defined as the sum total of a hash code for each element. * The per element hash code is defined as - * (e==null ? 0 : e.hashCode()) ^ noOccurances). + * {@code (e==null ? 0 : e.hashCode()) ^ noOccurances)}. * * @return the hash code of the MultiSet */ @@ -241,7 +241,7 @@ public interface MultiSet extends Collection { * and the two entries represent the same element with the same * number of occurrences. *

      - * More formally, two entries e1 and e2 represent + * More formally, two entries {@code e1} and {@code e2} represent * the same mapping if *

                *     (e1.getElement()==null ? e2.getElement()==null
      @@ -258,7 +258,7 @@ public interface MultiSet extends Collection {
               /**
                * Returns the hash code value for this multiset entry.
                * 

      - * The hash code of a multiset entry e is defined to be: + * The hash code of a multiset entry {@code e} is defined to be: *

                *      (e==null ? 0 : e.hashCode()) ^ noOccurances)
                * 
      diff --git a/src/main/java/org/apache/commons/collections4/MultiSetUtils.java b/src/main/java/org/apache/commons/collections4/MultiSetUtils.java index ba3c0193c..9eb25b0d7 100644 --- a/src/main/java/org/apache/commons/collections4/MultiSetUtils.java +++ b/src/main/java/org/apache/commons/collections4/MultiSetUtils.java @@ -105,7 +105,7 @@ public class MultiSetUtils { } /** - * Get an empty MultiSet. + * Get an empty {@code MultiSet}. * * @param the element type * @return an empty MultiSet diff --git a/src/main/java/org/apache/commons/collections4/MultiValuedMap.java b/src/main/java/org/apache/commons/collections4/MultiValuedMap.java index 8e303efc6..61b5dec16 100644 --- a/src/main/java/org/apache/commons/collections4/MultiValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/MultiValuedMap.java @@ -41,7 +41,7 @@ import java.util.Set; * Collection coll = map.get(1); * }
      *

      - * coll will be a collection containing "A", "B", "C". + * {@code coll} will be a collection containing "A", "B", "C". *

      * * @param the type of the keys in this map @@ -219,7 +219,7 @@ public interface MultiValuedMap { * Other values attached to that key are unaffected. *

      * If the last value for a key is removed, implementations typically return - * an empty collection from a subsequent get(Object). + * an empty collection from a subsequent {@code get(Object)}. * * @param key the key to remove from * @param item the item to remove @@ -311,7 +311,7 @@ public interface MultiValuedMap { // Iterators /** - * Obtains a MapIterator over this multi-valued map. + * Obtains a {@code MapIterator} over this multi-valued map. *

      * A map iterator is an efficient way of iterating over maps. There is no * need to access the entries collection or use {@code Map.Entry} objects. diff --git a/src/main/java/org/apache/commons/collections4/OrderedBidiMap.java b/src/main/java/org/apache/commons/collections4/OrderedBidiMap.java index 8b7ca3adf..36f3cc48e 100644 --- a/src/main/java/org/apache/commons/collections4/OrderedBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/OrderedBidiMap.java @@ -38,11 +38,11 @@ public interface OrderedBidiMap extends BidiMap, OrderedMap { * This enables both directions of the map to be accessed equally. *

      * Implementations should seek to avoid creating a new object every time this - * method is called. See AbstractMap.values() etc. Calling this + * method is called. See {@code AbstractMap.values()} etc. Calling this * method on the inverse map should return the original. *

      - * Implementations must return an OrderedBidiMap instance, - * usually by forwarding to inverseOrderedBidiMap(). + * Implementations must return an {@code OrderedBidiMap} instance, + * usually by forwarding to {@code inverseOrderedBidiMap()}. * * @return an inverted bidirectional map */ diff --git a/src/main/java/org/apache/commons/collections4/OrderedIterator.java b/src/main/java/org/apache/commons/collections4/OrderedIterator.java index 9ad992f0f..978251501 100644 --- a/src/main/java/org/apache/commons/collections4/OrderedIterator.java +++ b/src/main/java/org/apache/commons/collections4/OrderedIterator.java @@ -32,7 +32,7 @@ public interface OrderedIterator extends Iterator { /** * Checks to see if there is a previous element that can be iterated to. * - * @return true if the iterator has a previous element + * @return {@code true} if the iterator has a previous element */ boolean hasPrevious(); diff --git a/src/main/java/org/apache/commons/collections4/OrderedMap.java b/src/main/java/org/apache/commons/collections4/OrderedMap.java index 57c3e638e..324710f06 100644 --- a/src/main/java/org/apache/commons/collections4/OrderedMap.java +++ b/src/main/java/org/apache/commons/collections4/OrderedMap.java @@ -28,7 +28,7 @@ package org.apache.commons.collections4; public interface OrderedMap extends IterableMap { /** - * Obtains an OrderedMapIterator over the map. + * Obtains an {@code OrderedMapIterator} over the map. *

      * A ordered map iterator is an efficient way of iterating over maps * in both directions. diff --git a/src/main/java/org/apache/commons/collections4/OrderedMapIterator.java b/src/main/java/org/apache/commons/collections4/OrderedMapIterator.java index fedebeb49..344bb4626 100644 --- a/src/main/java/org/apache/commons/collections4/OrderedMapIterator.java +++ b/src/main/java/org/apache/commons/collections4/OrderedMapIterator.java @@ -17,7 +17,7 @@ package org.apache.commons.collections4; /** - * Defines an iterator that operates over an ordered Map. + * Defines an iterator that operates over an ordered {@code Map}. *

      * This iterator allows both forward and reverse iteration through the map. *

      @@ -31,13 +31,13 @@ public interface OrderedMapIterator extends MapIterator, OrderedIter /** * Checks to see if there is a previous entry that can be iterated to. * - * @return true if the iterator has a previous element + * @return {@code true} if the iterator has a previous element */ @Override boolean hasPrevious(); /** - * Gets the previous key from the Map. + * Gets the previous key from the {@code Map}. * * @return the previous key in the iteration * @throws java.util.NoSuchElementException if the iteration is finished diff --git a/src/main/java/org/apache/commons/collections4/Predicate.java b/src/main/java/org/apache/commons/collections4/Predicate.java index dcd9c619b..c7af795b1 100644 --- a/src/main/java/org/apache/commons/collections4/Predicate.java +++ b/src/main/java/org/apache/commons/collections4/Predicate.java @@ -20,7 +20,7 @@ package org.apache.commons.collections4; * Defines a functor interface implemented by classes that perform a predicate * test on an object. *

      - * A Predicate is the object equivalent of an if statement. + * A {@code Predicate} is the object equivalent of an {@code if} statement. * It uses the input object to return a true or false value, and is often used in * validation or filtering. *

      diff --git a/src/main/java/org/apache/commons/collections4/PredicateUtils.java b/src/main/java/org/apache/commons/collections4/PredicateUtils.java index 2243edfe1..8dd5d0ffc 100644 --- a/src/main/java/org/apache/commons/collections4/PredicateUtils.java +++ b/src/main/java/org/apache/commons/collections4/PredicateUtils.java @@ -42,7 +42,7 @@ import org.apache.commons.collections4.functors.TruePredicate; import org.apache.commons.collections4.functors.UniquePredicate; /** - * PredicateUtils provides reference implementations and utilities + * {@code PredicateUtils} provides reference implementations and utilities * for the Predicate functor interface. The supplied predicates are: *
        *
      • Invoker - returns the result of a method call on the input object @@ -162,8 +162,8 @@ public class PredicateUtils { /** * Creates a Predicate that checks if the object passed in is of - * a particular type, using instanceof. A null input - * object will return false. + * a particular type, using instanceof. A {@code null} input + * object will return {@code false}. * * @param type the type to check for, may not be null * @return the predicate @@ -177,7 +177,7 @@ public class PredicateUtils { /** * Creates a Predicate that returns true the first time an object is * encountered, and false if the same object is received - * again. The comparison is by equals(). A null input object + * again. The comparison is by equals(). A {@code null} input object * is accepted and will return true the first time, and false subsequently * as well. * @@ -196,8 +196,8 @@ public class PredicateUtils { * and have no parameters. If the input object is null, a * PredicateException is thrown. *

        - * For example, PredicateUtils.invokerPredicate("isEmpty"); - * will call the isEmpty method on the input object to + * For example, {@code PredicateUtils.invokerPredicate("isEmpty");} + * will call the {@code isEmpty} method on the input object to * determine the predicate result. * * @param the type that the predicate queries @@ -218,8 +218,8 @@ public class PredicateUtils { * and have no parameters. If the input object is null, a * PredicateException is thrown. *

        - * For example, PredicateUtils.invokerPredicate("isEmpty"); - * will call the isEmpty method on the input object to + * For example, {@code PredicateUtils.invokerPredicate("isEmpty");} + * will call the {@code isEmpty} method on the input object to * determine the predicate result. * * @param the type that the predicate queries @@ -248,7 +248,7 @@ public class PredicateUtils { * @param the type that the predicate queries * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null - * @return the and predicate + * @return the {@code and} predicate * @throws NullPointerException if either predicate is null * @see AndPredicate */ @@ -264,7 +264,7 @@ public class PredicateUtils { * * @param the type that the predicate queries * @param predicates an array of predicates to check, may not be null - * @return the all predicate + * @return the {@code all} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null * @see AllPredicate @@ -280,7 +280,7 @@ public class PredicateUtils { * * @param the type that the predicate queries * @param predicates a collection of predicates to check, may not be null - * @return the all predicate + * @return the {@code all} predicate * @throws NullPointerException if the predicates collection is null * @throws NullPointerException if any predicate in the collection is null * @see AllPredicate @@ -296,7 +296,7 @@ public class PredicateUtils { * @param the type that the predicate queries * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null - * @return the or predicate + * @return the {@code or} predicate * @throws NullPointerException if either predicate is null * @see OrPredicate */ @@ -312,7 +312,7 @@ public class PredicateUtils { * * @param the type that the predicate queries * @param predicates an array of predicates to check, may not be null - * @return the any predicate + * @return the {@code any} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null * @see AnyPredicate @@ -328,7 +328,7 @@ public class PredicateUtils { * * @param the type that the predicate queries * @param predicates a collection of predicates to check, may not be null - * @return the any predicate + * @return the {@code any} predicate * @throws NullPointerException if the predicates collection is null * @throws NullPointerException if any predicate in the collection is null * @see AnyPredicate @@ -344,7 +344,7 @@ public class PredicateUtils { * @param the type that the predicate queries * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null - * @return the either predicate + * @return the {@code either} predicate * @throws NullPointerException if either predicate is null * @see OnePredicate */ @@ -362,7 +362,7 @@ public class PredicateUtils { * * @param the type that the predicate queries * @param predicates an array of predicates to check, may not be null - * @return the one predicate + * @return the {@code one} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null * @see OnePredicate @@ -378,7 +378,7 @@ public class PredicateUtils { * * @param the type that the predicate queries * @param predicates a collection of predicates to check, may not be null - * @return the one predicate + * @return the {@code one} predicate * @throws NullPointerException if the predicates collection is null * @throws NullPointerException if any predicate in the collection is null * @see OnePredicate @@ -394,7 +394,7 @@ public class PredicateUtils { * @param the type that the predicate queries * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null - * @return the neither predicate + * @return the {@code neither} predicate * @throws NullPointerException if either predicate is null * @see NonePredicate */ @@ -412,7 +412,7 @@ public class PredicateUtils { * * @param the type that the predicate queries * @param predicates an array of predicates to check, may not be null - * @return the none predicate + * @return the {@code none} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null * @see NonePredicate @@ -428,7 +428,7 @@ public class PredicateUtils { * * @param the type that the predicate queries * @param predicates a collection of predicates to check, may not be null - * @return the none predicate + * @return the {@code none} predicate * @throws NullPointerException if the predicates collection is null * @throws NullPointerException if any predicate in the collection is null * @see NonePredicate @@ -443,7 +443,7 @@ public class PredicateUtils { * * @param the type that the predicate queries * @param predicate the predicate to not - * @return the not predicate + * @return the {@code not} predicate * @throws NullPointerException if the predicate is null * @see NotPredicate */ diff --git a/src/main/java/org/apache/commons/collections4/Put.java b/src/main/java/org/apache/commons/collections4/Put.java index cab99bf7d..687fd66b4 100644 --- a/src/main/java/org/apache/commons/collections4/Put.java +++ b/src/main/java/org/apache/commons/collections4/Put.java @@ -47,11 +47,11 @@ public interface Put { * * @param key key with which the specified value is to be associated * @param value value to be associated with the specified key - * @return the previous value associated with key, or - * null if there was no mapping for key. - * (A null return can also indicate that the map - * previously associated null with key, - * if the implementation supports null values.) + * @return the previous value associated with {@code key}, or + * {@code null} if there was no mapping for {@code key}. + * (A {@code null} return can also indicate that the map + * previously associated {@code null} with {@code key}, + * if the implementation supports {@code null} values.) * @see Map#put(Object, Object) */ Object put(K key, V value); diff --git a/src/main/java/org/apache/commons/collections4/QueueUtils.java b/src/main/java/org/apache/commons/collections4/QueueUtils.java index ee4114bea..27d8c3de7 100644 --- a/src/main/java/org/apache/commons/collections4/QueueUtils.java +++ b/src/main/java/org/apache/commons/collections4/QueueUtils.java @@ -38,7 +38,7 @@ public class QueueUtils { public static final Queue EMPTY_QUEUE = UnmodifiableQueue.unmodifiableQueue(new LinkedList<>()); /** - * QueueUtils should not normally be instantiated. + * {@code QueueUtils} should not normally be instantiated. */ private QueueUtils() {} @@ -127,7 +127,7 @@ public class QueueUtils { } /** - * Get an empty Queue. + * Get an empty {@code Queue}. * * @param the type of the elements in the queue * @return an empty {@link Queue} diff --git a/src/main/java/org/apache/commons/collections4/SetUtils.java b/src/main/java/org/apache/commons/collections4/SetUtils.java index 1205ece3c..658af05b5 100644 --- a/src/main/java/org/apache/commons/collections4/SetUtils.java +++ b/src/main/java/org/apache/commons/collections4/SetUtils.java @@ -187,12 +187,12 @@ public class SetUtils { } /** - * Returns an immutable empty set if the argument is null, + * Returns an immutable empty set if the argument is {@code null}, * or the argument itself otherwise. * * @param the element type - * @param set the set, possibly null - * @return an empty set if the argument is null + * @param set the set, possibly {@code null} + * @return an empty set if the argument is {@code null} */ public static Set emptyIfNull(final Set set) { return set == null ? Collections.emptySet() : set; @@ -223,7 +223,7 @@ public class SetUtils { * Generates a hash code using the algorithm specified in * {@link java.util.Set#hashCode()}. *

        - * This method is useful for implementing Set when you cannot + * This method is useful for implementing {@code Set} when you cannot * extend AbstractSet. The method takes Collection instances to enable other * collection types to use the Set implementation algorithm. * @@ -294,10 +294,10 @@ public class SetUtils { } /** - * Tests two sets for equality as per the equals() contract + * Tests two sets for equality as per the {@code equals()} contract * in {@link java.util.Set#equals(java.lang.Object)}. *

        - * This method is useful for implementing Set when you cannot + * This method is useful for implementing {@code Set} when you cannot * extend AbstractSet. The method takes Collection instances to enable other * collection types to use the Set implementation algorithm. *

        @@ -333,8 +333,8 @@ public class SetUtils { } /** - * Returns a new hash set that matches elements based on == not - * equals(). + * Returns a new hash set that matches elements based on {@code ==} not + * {@code equals()}. *

        * This set will violate the detail of various Set contracts. * As a general rule, don't compare this set to other sets. In particular, you can't @@ -656,7 +656,7 @@ public class SetUtils { } /** - * SetUtils should not normally be instantiated. + * {@code SetUtils} should not normally be instantiated. */ private SetUtils() {} } diff --git a/src/main/java/org/apache/commons/collections4/SortedBag.java b/src/main/java/org/apache/commons/collections4/SortedBag.java index 24324b0f5..b1ce6e0c4 100644 --- a/src/main/java/org/apache/commons/collections4/SortedBag.java +++ b/src/main/java/org/apache/commons/collections4/SortedBag.java @@ -19,7 +19,7 @@ package org.apache.commons.collections4; import java.util.Comparator; /** - * Defines a type of Bag that maintains a sorted order among + * Defines a type of {@code Bag} that maintains a sorted order among * its unique representative members. * * @param the type of elements in this bag diff --git a/src/main/java/org/apache/commons/collections4/SortedBidiMap.java b/src/main/java/org/apache/commons/collections4/SortedBidiMap.java index d9c7189fc..e2254ea8e 100644 --- a/src/main/java/org/apache/commons/collections4/SortedBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/SortedBidiMap.java @@ -40,11 +40,11 @@ public interface SortedBidiMap extends OrderedBidiMap, SortedMap * Implementations should seek to avoid creating a new object every time this - * method is called. See AbstractMap.values() etc. Calling this + * method is called. See {@code AbstractMap.values()} etc. Calling this * method on the inverse map should return the original. *

        - * Implementations must return a SortedBidiMap instance, - * usually by forwarding to inverseSortedBidiMap(). + * Implementations must return a {@code SortedBidiMap} instance, + * usually by forwarding to {@code inverseSortedBidiMap()}. * * @return an inverted bidirectional map */ diff --git a/src/main/java/org/apache/commons/collections4/SplitMapUtils.java b/src/main/java/org/apache/commons/collections4/SplitMapUtils.java index c5c58b53f..cff8dc679 100644 --- a/src/main/java/org/apache/commons/collections4/SplitMapUtils.java +++ b/src/main/java/org/apache/commons/collections4/SplitMapUtils.java @@ -39,7 +39,7 @@ import org.apache.commons.collections4.set.UnmodifiableSet; public class SplitMapUtils { /** - * SplitMapUtils should not normally be instantiated. + * {@code SplitMapUtils} should not normally be instantiated. */ private SplitMapUtils() {} @@ -223,8 +223,8 @@ public class SplitMapUtils { /** * Get the specified {@link Get} as an instance of {@link IterableMap}. - * If get implements {@link IterableMap} directly, no conversion will take place. - * If get implements {@link Map} but not {@link IterableMap} it will be decorated. + * If {@code get} implements {@link IterableMap} directly, no conversion will take place. + * If {@code get} implements {@link Map} but not {@link IterableMap} it will be decorated. * Otherwise an {@link Unmodifiable} {@link IterableMap} will be returned. * @param the key type * @param the value type @@ -245,10 +245,10 @@ public class SplitMapUtils { /** * Get the specified {@link Put} as an instanceof {@link Map}. - * If put implements {@link Map} directly, no conversion will take place. + * If {@code put} implements {@link Map} directly, no conversion will take place. * Otherwise a write-only {@link Map} will be returned. On such a {@link Map} * it is recommended that the result of #put(K, V) be discarded as it likely will not - * match V at runtime. + * match {@code V} at runtime. * * @param the key type * @param the element type diff --git a/src/main/java/org/apache/commons/collections4/Transformer.java b/src/main/java/org/apache/commons/collections4/Transformer.java index 5cf66988e..cdf2ab9eb 100644 --- a/src/main/java/org/apache/commons/collections4/Transformer.java +++ b/src/main/java/org/apache/commons/collections4/Transformer.java @@ -20,7 +20,7 @@ package org.apache.commons.collections4; * Defines a functor interface implemented by classes that transform one * object into another. *

        - * A Transformer converts the input object to the output object. + * A {@code Transformer} converts the input object to the output object. * The input object should be left unchanged. * Transformers are typically used for type conversions, or extracting data * from an object. diff --git a/src/main/java/org/apache/commons/collections4/TransformerUtils.java b/src/main/java/org/apache/commons/collections4/TransformerUtils.java index 12293acd0..76c09d58b 100644 --- a/src/main/java/org/apache/commons/collections4/TransformerUtils.java +++ b/src/main/java/org/apache/commons/collections4/TransformerUtils.java @@ -37,7 +37,7 @@ import org.apache.commons.collections4.functors.StringValueTransformer; import org.apache.commons.collections4.functors.SwitchTransformer; /** - * TransformerUtils provides reference implementations and + * {@code TransformerUtils} provides reference implementations and * utilities for the Transformer functor interface. The supplied transformers are: *

          *
        • Invoker - returns the result of a method call on the input object @@ -55,7 +55,7 @@ import org.apache.commons.collections4.functors.SwitchTransformer; *
        • Null - always returns null *
        • NOP - returns the input object, which should be immutable *
        • Exception - always throws an exception - *
        • StringValue - returns a java.lang.String representation of the input object + *
        • StringValue - returns a {@code java.lang.String} representation of the input object *
        *

        * Since v4.1 only transformers which are considered to be safe are @@ -433,8 +433,8 @@ public class TransformerUtils { * {@code null} is returned. * *

        - * For example, TransformerUtils.invokerTransformer("getName"); - * will call the getName method on the input object to + * For example, {@code TransformerUtils.invokerTransformer("getName");} + * will call the {@code getName} method on the input object to * determine the transformer result. *

        * @@ -470,9 +470,9 @@ public class TransformerUtils { } /** - * Gets a transformer that returns a java.lang.String + * Gets a transformer that returns a {@code java.lang.String} * representation of the input object. This is achieved via the - * toString method, null returns 'null'. + * {@code toString} method, {@code null} returns 'null'. * * @param the input type * @return the transformer diff --git a/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java b/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java index a1486ea62..3d4bf60a9 100644 --- a/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java +++ b/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java @@ -22,7 +22,7 @@ import org.apache.commons.collections4.Bag; import org.apache.commons.collections4.collection.AbstractCollectionDecorator; /** - * Decorates another Bag to provide additional behaviour. + * Decorates another {@code Bag} to provide additional behaviour. *

        * Methods are forwarded directly to the decorated bag. *

        diff --git a/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java b/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java index 9ee1ae379..b5b984570 100644 --- a/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java +++ b/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java @@ -135,7 +135,7 @@ public abstract class AbstractMapBag implements Bag { * Determines if the bag contains the given elements. * * @param coll the collection to check against - * @return true if the Bag contains all the collection + * @return {@code true} if the Bag contains all the collection */ @Override public boolean containsAll(final Collection coll) { @@ -146,11 +146,11 @@ public abstract class AbstractMapBag implements Bag { } /** - * Returns true if the bag contains all elements in the given + * Returns {@code true} if the bag contains all elements in the given * collection, respecting cardinality. * * @param other the bag to check against - * @return true if the Bag contains all the collection + * @return {@code true} if the Bag contains all the collection */ boolean containsAll(final Bag other) { final Iterator it = other.uniqueSet().iterator(); @@ -245,7 +245,7 @@ public abstract class AbstractMapBag implements Bag { * Adds a new element to the bag, incrementing its count in the underlying map. * * @param object the object to add - * @return true if the object was not already in the uniqueSet + * @return {@code true} if the object was not already in the {@code uniqueSet} */ @Override public boolean add(final E object) { @@ -257,7 +257,7 @@ public abstract class AbstractMapBag implements Bag { * * @param object the object to search for * @param nCopies the number of copies to add - * @return true if the object was not already in the uniqueSet + * @return {@code true} if the object was not already in the {@code uniqueSet} */ @Override public boolean add(final E object, final int nCopies) { @@ -279,7 +279,7 @@ public abstract class AbstractMapBag implements Bag { * Invokes {@link #add(Object)} for each element in the given collection. * * @param coll the collection to add - * @return true if this call changed the bag + * @return {@code true} if this call changed the bag */ @Override public boolean addAll(final Collection coll) { @@ -389,7 +389,7 @@ public abstract class AbstractMapBag implements Bag { * @see #retainAll(Collection) * * @param other the bag to retain - * @return true if this call changed the collection + * @return {@code true} if this call changed the collection */ boolean retainAll(final Bag other) { boolean result = false; @@ -579,7 +579,7 @@ public abstract class AbstractMapBag implements Bag { * Gets a hash code for the Bag compatible with the definition of equals. * The hash code is defined as the sum total of a hash code for each * element. The per element hash code is defined as - * (e==null ? 0 : e.hashCode()) ^ noOccurances). This hash code + * {@code (e==null ? 0 : e.hashCode()) ^ noOccurances)}. This hash code * is compatible with the Set interface. * * @return the hash code of the Bag diff --git a/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java b/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java index 42daebc91..1682b563e 100644 --- a/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java +++ b/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java @@ -21,7 +21,7 @@ import java.util.Comparator; import org.apache.commons.collections4.SortedBag; /** - * Decorates another SortedBag to provide additional behaviour. + * Decorates another {@code SortedBag} to provide additional behaviour. *

        * Methods are forwarded directly to the decorated bag. *

        diff --git a/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java b/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java index f8e22f13c..4ae4d42a3 100644 --- a/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java +++ b/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java @@ -99,13 +99,13 @@ public final class CollectionBag extends AbstractBagDecorator { /** * (Change) - * Returns true if the bag contains all elements in + * Returns {@code true} if the bag contains all elements in * the given collection, not respecting cardinality. That is, - * if the given collection coll contains at least one of + * if the given collection {@code coll} contains at least one of * every object contained in this object. * * @param coll the collection to check against - * @return true if the Bag contains at least one of every object in the collection + * @return {@code true} if the Bag contains at least one of every object in the collection */ @Override public boolean containsAll(final Collection coll) { @@ -123,10 +123,10 @@ public final class CollectionBag extends AbstractBagDecorator { * Adds one copy of the specified object to the Bag. *

        * Since this method always increases the size of the bag, it - * will always return true. + * will always return {@code true}. * * @param object the object to add - * @return true, always + * @return {@code true}, always */ @Override public boolean add(final E object) { @@ -152,7 +152,7 @@ public final class CollectionBag extends AbstractBagDecorator { * bag contains no occurrence anymore of the object after this operation. * * @param object the object to remove - * @return true if this call changed the collection + * @return {@code true} if this call changed the collection */ @Override public boolean remove(final Object object) { @@ -166,7 +166,7 @@ public final class CollectionBag extends AbstractBagDecorator { * occurrences of every object contained in the given collection. * * @param coll the collection to remove - * @return true if this call changed the collection + * @return {@code true} if this call changed the collection */ @Override public boolean removeAll(final Collection coll) { @@ -188,18 +188,18 @@ public final class CollectionBag extends AbstractBagDecorator { * (Change) * Remove any members of the bag that are not in the given collection, * not respecting cardinality. That is, any object in the given - * collection coll will be retained in the bag with the same + * collection {@code coll} will be retained in the bag with the same * number of copies prior to this operation. All other objects will be * completely removed from this bag. *

        * This implementation iterates over the elements of this bag, checking - * each element in turn to see if it's contained in coll. + * each element in turn to see if it's contained in {@code coll}. * If it's not contained, it's removed from this bag. As a consequence, - * it is advised to use a collection type for coll that provides + * it is advised to use a collection type for {@code coll} that provides * a fast (e.g. O(1)) implementation of {@link Collection#contains(Object)}. * * @param coll the collection to retain - * @return true if this call changed the collection + * @return {@code true} if this call changed the collection */ @Override public boolean retainAll(final Collection coll) { @@ -224,14 +224,14 @@ public final class CollectionBag extends AbstractBagDecorator { /** * (Change) - * Adds count copies of the specified object to the Bag. + * Adds {@code count} copies of the specified object to the Bag. *

        * Since this method always increases the size of the bag, it - * will always return true. + * will always return {@code true}. * * @param object the object to add * @param count the number of copies to add - * @return true, always + * @return {@code true}, always */ @Override public boolean add(final E object, final int count) { diff --git a/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java index 790ace2d7..ddef8f268 100644 --- a/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java @@ -77,7 +77,7 @@ public abstract class AbstractDualBidiMap implements BidiMap { transient Set> entrySet = null; /** - * Creates an empty map, initialised by createMap. + * Creates an empty map, initialised by {@code createMap}. *

        * This constructor remains in place for deserialization. * All other usage is deprecated in favour of @@ -95,7 +95,7 @@ public abstract class AbstractDualBidiMap implements BidiMap { *

        * Neither map is validated, so nulls may be passed in. * If you choose to do this then the subclass constructor must populate - * the maps[] instance variable itself. + * the {@code maps[]} instance variable itself. * * @param normalMap the normal direction map * @param reverseMap the reverse direction map @@ -109,7 +109,7 @@ public abstract class AbstractDualBidiMap implements BidiMap { /** * Constructs a map that decorates the specified maps, - * used by the subclass createBidiMap implementation. + * used by the subclass {@code createBidiMap} implementation. * * @param normalMap the normal direction map * @param reverseMap the reverse direction map @@ -218,8 +218,8 @@ public abstract class AbstractDualBidiMap implements BidiMap { // BidiMap //----------------------------------------------------------------------- /** - * Obtains a MapIterator over the map. - * The iterator implements ResetableMapIterator. + * Obtains a {@code MapIterator} over the map. + * The iterator implements {@code ResetableMapIterator}. * This implementation relies on the entrySet iterator. *

        * The setValue() methods only allow a new value to be set. @@ -411,9 +411,9 @@ public abstract class AbstractDualBidiMap implements BidiMap { * {@inheritDoc} *

        * This implementation iterates over the elements of this bidi map, checking each element in - * turn to see if it's contained in coll. If it's not contained, it's removed + * turn to see if it's contained in {@code coll}. If it's not contained, it's removed * from this bidi map. As a consequence, it is advised to use a collection type for - * coll that provides a fast (e.g. O(1)) implementation of + * {@code coll} that provides a fast (e.g. O(1)) implementation of * {@link Collection#contains(Object)}. */ @Override diff --git a/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java index fa0d9f2b9..3d791acaf 100644 --- a/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java @@ -35,7 +35,7 @@ import org.apache.commons.collections4.BidiMap; *

        *

        * NOTE: From Commons Collections 3.1, all subclasses will use {@link HashMap} - * and the flawed createMap method is ignored. + * and the flawed {@code createMap} method is ignored. *

        * * @param the type of the keys in the map @@ -49,15 +49,15 @@ public class DualHashBidiMap extends AbstractDualBidiMap implements private static final long serialVersionUID = 721969328361808L; /** - * Creates an empty HashBidiMap. + * Creates an empty {@code HashBidiMap}. */ public DualHashBidiMap() { super(new HashMap(), new HashMap()); } /** - * Constructs a HashBidiMap and copies the mappings from - * specified Map. + * Constructs a {@code HashBidiMap} and copies the mappings from + * specified {@code Map}. * * @param map the map whose mappings are to be placed in this map */ @@ -67,7 +67,7 @@ public class DualHashBidiMap extends AbstractDualBidiMap implements } /** - * Constructs a HashBidiMap that decorates the specified maps. + * Constructs a {@code HashBidiMap} that decorates the specified maps. * * @param normalMap the normal direction map * @param reverseMap the reverse direction map diff --git a/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java index 36df6ad10..d48670781 100644 --- a/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java @@ -26,9 +26,9 @@ import java.util.Map; import org.apache.commons.collections4.BidiMap; /** - * Implementation of BidiMap that uses two LinkedHashMap instances. + * Implementation of {@code BidiMap} that uses two {@code LinkedHashMap} instances. *

        - * Two LinkedHashMap instances are used in this class. + * Two {@code LinkedHashMap} instances are used in this class. * This provides fast lookups at the expense of storing two sets of map entries and two linked lists. *

        * @@ -43,15 +43,15 @@ public class DualLinkedHashBidiMap extends AbstractDualBidiMap imple private static final long serialVersionUID = 721969328361810L; /** - * Creates an empty HashBidiMap. + * Creates an empty {@code HashBidiMap}. */ public DualLinkedHashBidiMap() { super(new LinkedHashMap(), new LinkedHashMap()); } /** - * Constructs a LinkedHashBidiMap and copies the mappings from - * specified Map. + * Constructs a {@code LinkedHashBidiMap} and copies the mappings from + * specified {@code Map}. * * @param map the map whose mappings are to be placed in this map */ @@ -61,7 +61,7 @@ public class DualLinkedHashBidiMap extends AbstractDualBidiMap imple } /** - * Constructs a LinkedHashBidiMap that decorates the specified maps. + * Constructs a {@code LinkedHashBidiMap} that decorates the specified maps. * * @param normalMap the normal direction map * @param reverseMap the reverse direction map diff --git a/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java index 748eecc1f..78c258435 100644 --- a/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java @@ -49,7 +49,7 @@ import org.apache.commons.collections4.map.AbstractSortedMapDecorator; *

        *

        * NOTE: From Commons Collections 3.1, all subclasses will use {@link TreeMap} - * and the flawed createMap method is ignored. + * and the flawed {@code createMap} method is ignored. *

        * * @param the type of the keys in this map @@ -69,7 +69,7 @@ public class DualTreeBidiMap extends AbstractDualBidiMap private final Comparator valueComparator; /** - * Creates an empty DualTreeBidiMap + * Creates an empty {@code DualTreeBidiMap} */ public DualTreeBidiMap() { super(new TreeMap(), new TreeMap()); @@ -78,8 +78,8 @@ public class DualTreeBidiMap extends AbstractDualBidiMap } /** - * Constructs a DualTreeBidiMap and copies the mappings from - * specified Map. + * Constructs a {@code DualTreeBidiMap} and copies the mappings from + * specified {@code Map}. * * @param map the map whose mappings are to be placed in this map */ diff --git a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java index 9f32827ac..0022b5dcc 100644 --- a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java @@ -41,7 +41,7 @@ import org.apache.commons.collections4.keyvalue.UnmodifiableMapEntry; /** * Red-Black tree-based implementation of BidiMap where all objects added - * implement the Comparable interface. + * implement the {@code Comparable} interface. *

        * This class guarantees that the map will be in both ascending key order * and ascending value order, sorted according to the natural order for @@ -163,7 +163,7 @@ public class TreeBidiMap, V extends Comparable> /** * Checks whether this map contains the a mapping for the specified key. *

        - * The key must implement Comparable. + * The key must implement {@code Comparable}. * * @param key key whose presence in this map is to be tested * @return true if this map contains a mapping for the specified key @@ -179,7 +179,7 @@ public class TreeBidiMap, V extends Comparable> /** * Checks whether this map contains the a mapping for the specified value. *

        - * The value must implement Comparable. + * The value must implement {@code Comparable}. * * @param value value whose presence in this map is to be tested * @return true if this map contains a mapping for the specified value @@ -196,7 +196,7 @@ public class TreeBidiMap, V extends Comparable> * Gets the value to which this map maps the specified key. * Returns null if the map contains no mapping for this key. *

        - * The key must implement Comparable. + * The key must implement {@code Comparable}. * * @param key key whose associated value is to be returned * @return the value to which this map maps the specified key, @@ -227,7 +227,7 @@ public class TreeBidiMap, V extends Comparable> * map.put("C","B"); // contains C mapped to B, key A is removed * *

        - * Both key and value must implement Comparable. + * Both key and value must implement {@code Comparable}. * * @param key key with which the specified value is to be associated * @param value value to be associated with the specified key @@ -245,7 +245,7 @@ public class TreeBidiMap, V extends Comparable> /** * Puts all the mappings from the specified map into this map. *

        - * All keys and values must implement Comparable. + * All keys and values must implement {@code Comparable}. * * @param map the map to copy from */ @@ -259,7 +259,7 @@ public class TreeBidiMap, V extends Comparable> /** * Removes the mapping for this key from this map if present. *

        - * The key must implement Comparable. + * The key must implement {@code Comparable}. * * @param key key whose mapping is to be removed from the map. * @return previous value associated with specified key, @@ -289,7 +289,7 @@ public class TreeBidiMap, V extends Comparable> * Returns the key to which this map maps the specified value. * Returns null if the map contains no mapping for this value. *

        - * The value must implement Comparable. + * The value must implement {@code Comparable}. * * @param value value whose associated key is to be returned. * @return the key to which this map maps the specified value, @@ -307,7 +307,7 @@ public class TreeBidiMap, V extends Comparable> /** * Removes the mapping for this value from this map if present. *

        - * The value must implement Comparable. + * The value must implement {@code Comparable}. * * @param value value whose mapping is to be removed from the map * @return previous key associated with specified value, @@ -352,7 +352,7 @@ public class TreeBidiMap, V extends Comparable> /** * Gets the next key after the one specified. *

        - * The key must implement Comparable. + * The key must implement {@code Comparable}. * * @param key the key to search for next from * @return the next key, null if no match or at end @@ -367,7 +367,7 @@ public class TreeBidiMap, V extends Comparable> /** * Gets the previous key before the one specified. *

        - * The key must implement Comparable. + * The key must implement {@code Comparable}. * * @param key the key to search for previous from * @return the previous key, null if no match or at start diff --git a/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java b/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java index c8d72802c..7b58c8e6e 100644 --- a/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java +++ b/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java @@ -23,13 +23,13 @@ import java.util.Objects; import java.util.function.Predicate; /** - * Decorates another Collection to provide additional behaviour. + * Decorates another {@code Collection} to provide additional behaviour. *

        - * Each method call made on this Collection is forwarded to the - * decorated Collection. This class is used as a framework on which + * Each method call made on this {@code Collection} is forwarded to the + * decorated {@code Collection}. This class is used as a framework on which * to build to extensions such as synchronized and unmodifiable behaviour. The * main advantage of decoration is that one decorator can wrap any implementation - * of Collection, whereas sub-classing requires a new class to be + * of {@code Collection}, whereas sub-classing requires a new class to be * written for each implementation. *

        *

        diff --git a/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java b/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java index 1f41be2e5..4e6b5759b 100644 --- a/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java +++ b/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java @@ -94,7 +94,7 @@ public class CompositeCollection implements Collection, Serializable { /** * Gets the size of this composite collection. *

        - * This implementation calls size() on each collection. + * This implementation calls {@code size()} on each collection. *

        * @return total number of elements in all contained containers */ @@ -110,7 +110,7 @@ public class CompositeCollection implements Collection, Serializable { /** * Checks whether this composite collection is empty. *

        - * This implementation calls isEmpty() on each collection. + * This implementation calls {@code isEmpty()} on each collection. *

        * @return true if all of the contained collections are empty */ @@ -127,7 +127,7 @@ public class CompositeCollection implements Collection, Serializable { /** * Checks whether this composite collection contains the object. *

        - * This implementation calls contains() on each collection. + * This implementation calls {@code contains()} on each collection. *

        * @param obj the object to search for * @return true if obj is contained in any of the contained collections @@ -145,10 +145,10 @@ public class CompositeCollection implements Collection, Serializable { /** * Gets an iterator over all the collections in this composite. *

        - * This implementation uses an IteratorChain. + * This implementation uses an {@code IteratorChain}. *

        - * @return an IteratorChain instance which supports - * remove(). Iteration occurs over contained collections in + * @return an {@code IteratorChain} instance which supports + * {@code remove()}. Iteration occurs over contained collections in * the order they were added, but this behavior should not be relied upon. * @see IteratorChain */ @@ -181,7 +181,7 @@ public class CompositeCollection implements Collection, Serializable { /** * Returns an object array, populating the supplied array if possible. - * See Collection interface for full details. + * See {@code Collection} interface for full details. * * @param the type of the elements in the collection * @param array the array to use, populating if possible @@ -254,7 +254,7 @@ public class CompositeCollection implements Collection, Serializable { /** * Checks whether this composite contains all the elements in the specified collection. *

        - * This implementation calls contains() for each element in the + * This implementation calls {@code contains()} for each element in the * specified collection. *

        * @param coll the collection to check for @@ -297,7 +297,7 @@ public class CompositeCollection implements Collection, Serializable { /** * Removes the elements in the specified collection from this composite collection. *

        - * This implementation calls removeAll on each collection. + * This implementation calls {@code removeAll} on each collection. *

        * @param coll the collection to remove * @return true if the collection was modified @@ -318,7 +318,7 @@ public class CompositeCollection implements Collection, Serializable { /** * Removes all of the elements of this collection that satisfy the given predicate from this composite collection. *

        - * This implementation calls removeIf on each collection. + * This implementation calls {@code removeIf} on each collection. *

        * @param filter a predicate which returns true for elements to be removed * @return true if the collection was modified @@ -341,7 +341,7 @@ public class CompositeCollection implements Collection, Serializable { * Retains all the elements in the specified collection in this composite collection, * removing all others. *

        - * This implementation calls retainAll() on each collection. + * This implementation calls {@code retainAll()} on each collection. *

        * @param coll the collection to remove * @return true if the collection was modified @@ -361,7 +361,7 @@ public class CompositeCollection implements Collection, Serializable { /** * Removes all of the elements from this collection . *

        - * This implementation calls clear() on each collection. + * This implementation calls {@code clear()} on each collection. *

        * @throws UnsupportedOperationException if clear is unsupported */ diff --git a/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java b/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java index 3a2b9f23e..baa36f512 100644 --- a/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java +++ b/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java @@ -55,7 +55,7 @@ public final class UnmodifiableBoundedCollection extends AbstractCollectionDe * Factory method to create an unmodifiable bounded collection. * * @param the type of the elements in the collection - * @param coll the BoundedCollection to decorate, must not be null + * @param coll the {@code BoundedCollection} to decorate, must not be null * @return a new unmodifiable bounded collection * @throws NullPointerException if {@code coll} is {@code null} * @since 4.0 @@ -76,7 +76,7 @@ public final class UnmodifiableBoundedCollection extends AbstractCollectionDe * to find a suitable BoundedCollection. * * @param the type of the elements in the collection - * @param collection the BoundedCollection to decorate, must not be null + * @param collection the {@code BoundedCollection} to decorate, must not be null * @return a new unmodifiable bounded collection * @throws NullPointerException if coll is null * @throws IllegalArgumentException if coll is not a {@code BoundedCollection} diff --git a/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java b/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java index 83be39090..7d273554f 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java +++ b/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java @@ -40,13 +40,13 @@ public final class BooleanComparator implements Comparator, Serializabl /** Constant "false first" reference. */ private static final BooleanComparator FALSE_FIRST = new BooleanComparator(false); - /** true iff true values sort before false values. */ + /** {@code true} iff {@code true} values sort before {@code false} values. */ private boolean trueFirst = false; //----------------------------------------------------------------------- /** * Returns a BooleanComparator instance that sorts - * true values before false values. + * {@code true} values before {@code false} values. *

        * Clients are encouraged to use the value returned from * this method instead of constructing a new instance @@ -63,7 +63,7 @@ public final class BooleanComparator implements Comparator, Serializabl /** * Returns a BooleanComparator instance that sorts - * false values before true values. + * {@code false} values before {@code true} values. *

        * Clients are encouraged to use the value returned from * this method instead of constructing a new instance @@ -80,8 +80,8 @@ public final class BooleanComparator implements Comparator, Serializabl /** * Returns a BooleanComparator instance that sorts - * trueFirst values before - * !trueFirst values. + * {@code trueFirst} values before + * {@code !trueFirst} values. *

        * Clients are encouraged to use the value returned from * this method instead of constructing a new instance @@ -90,8 +90,8 @@ public final class BooleanComparator implements Comparator, Serializabl * virtual machine. *

        * - * @param trueFirst when true, sort - * true Booleans before false + * @param trueFirst when {@code true}, sort + * {@code true} {@code Boolean}s before {@code false} * @return a singleton BooleanComparator instance * @since 4.0 */ @@ -101,8 +101,8 @@ public final class BooleanComparator implements Comparator, Serializabl //----------------------------------------------------------------------- /** - * Creates a BooleanComparator that sorts - * false values before true values. + * Creates a {@code BooleanComparator} that sorts + * {@code false} values before {@code true} values. *

        * Equivalent to {@link #BooleanComparator(boolean) BooleanComparator(false)}. *

        @@ -113,14 +113,14 @@ public final class BooleanComparator implements Comparator, Serializabl } /** - * Creates a BooleanComparator that sorts - * trueFirst values before - * !trueFirst values. + * Creates a {@code BooleanComparator} that sorts + * {@code trueFirst} values before + * {@code !trueFirst} values. *

        * Please use the static factories instead whenever possible. * - * @param trueFirst when true, sort - * true boolean values before false + * @param trueFirst when {@code true}, sort + * {@code true} boolean values before {@code false} */ public BooleanComparator(final boolean trueFirst) { this.trueFirst = trueFirst; @@ -128,13 +128,13 @@ public final class BooleanComparator implements Comparator, Serializabl //----------------------------------------------------------------------- /** - * Compares two non-null Boolean objects + * Compares two non-{@code null} {@code Boolean} objects * according to the value of {@link #sortsTrueFirst()}. * * @param b1 the first boolean to compare * @param b2 the second boolean to compare * @return negative if obj1 is less, positive if greater, zero if equal - * @throws NullPointerException when either argument null + * @throws NullPointerException when either argument {@code null} */ @Override public int compare(final Boolean b1, final Boolean b2) { @@ -158,12 +158,12 @@ public final class BooleanComparator implements Comparator, Serializabl } /** - * Returns true iff that Object is + * Returns {@code true} iff that Object is * is a {@link Comparator} whose ordering is known to be * equivalent to mine. *

        - * This implementation returns true - * iff that is a {@link BooleanComparator} + * This implementation returns {@code true} + * iff {@code that} is a {@link BooleanComparator} * whose value of {@link #sortsTrueFirst()} is equal to mine. * * @param object the object to compare to @@ -178,10 +178,10 @@ public final class BooleanComparator implements Comparator, Serializabl //----------------------------------------------------------------------- /** - * Returns true iff - * I sort true values before - * false values. In other words, - * returns true iff + * Returns {@code true} iff + * I sort {@code true} values before + * {@code false} values. In other words, + * returns {@code true} iff * {@link #compare(Boolean,Boolean) compare(Boolean.FALSE,Boolean.TRUE)} * returns a positive value. * diff --git a/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java b/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java index c22fd5c2e..0412c5896 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java +++ b/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java @@ -30,7 +30,7 @@ import java.util.Comparator; *

        * 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 - * {@link #compare(Object, Object) compare} were null, not + * {@link #compare(Object, Object) compare} were {@code null}, not * {@link Comparable Comparable}, or for which * {@link Comparable#compareTo(Object) compareTo} gave inconsistent results. * This is no longer the case. See {@link #compare(Object, Object) compare} for @@ -86,10 +86,10 @@ public class ComparableComparator> implements Co * @param obj1 the first object to compare * @param obj2 the second object to compare * @return negative if obj1 is less, positive if greater, zero if equal - * @throws NullPointerException if obj1 is null, - * or when ((Comparable)obj1).compareTo(obj2) does - * @throws ClassCastException if obj1 is not a Comparable, - * or when ((Comparable)obj1).compareTo(obj2) does + * @throws NullPointerException if obj1 is {@code null}, + * or when {@code ((Comparable)obj1).compareTo(obj2)} does + * @throws ClassCastException if obj1 is not a {@code Comparable}, + * or when {@code ((Comparable)obj1).compareTo(obj2)} does */ @Override public int compare(final E obj1, final E obj2) { @@ -114,8 +114,8 @@ public class ComparableComparator> implements Co * whose ordering is known to be equivalent to mine. *

        * This implementation returns {@code true} iff - * object.{@link Object#getClass() getClass()} equals - * this.getClass(). Subclasses may want to override this behavior to remain + * {@code object.{@link Object#getClass() getClass()}} equals + * {@code this.getClass()}. Subclasses may want to override this behavior to remain * consistent with the {@link Comparator#equals(Object)} contract. * * @param object the object to compare with diff --git a/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java b/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java index 576d8502c..0af0d5d13 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java +++ b/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java @@ -317,13 +317,13 @@ public class ComparatorChain implements Comparator, Serializable { } /** - * Returns true iff that Object is + * Returns {@code true} iff that Object is * is a {@link Comparator} whose ordering is known to be * equivalent to mine. *

        - * This implementation returns true - * iff object.{@link Object#getClass() getClass()} - * equals this.getClass(), and the underlying + * This implementation returns {@code true} + * iff {@code object.{@link Object#getClass() getClass()}} + * equals {@code this.getClass()}, and the underlying * comparators and order bits are equal. * Subclasses may want to override this behavior to remain consistent * with the {@link Comparator#equals(Object)} contract. diff --git a/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java b/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java index fe3b51c8d..c03a80b09 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java +++ b/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java @@ -35,7 +35,7 @@ import java.util.Objects; * Arrays.sort(planets, distanceFromSun); // Back to original order * *

        - * Once compare has been called, the FixedOrderComparator is locked + * Once {@code compare} has been called, the FixedOrderComparator is locked * and attempts to modify it yield an UnsupportedOperationException. *

        *

        @@ -260,12 +260,12 @@ public class FixedOrderComparator implements Comparator, Serializable { } /** - * Returns true iff that Object is + * Returns {@code true} iff that Object is * is a {@link Comparator} whose ordering is known to be * equivalent to mine. *

        - * This implementation returns true - * iff that is a {@link FixedOrderComparator} + * This implementation returns {@code true} + * iff {@code that} is a {@link FixedOrderComparator} * whose attributes are equal to mine. * * @param object the object to compare to diff --git a/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java b/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java index eca1376e1..669373580 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java +++ b/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java @@ -35,21 +35,21 @@ public class NullComparator implements Comparator, Serializable { private static final long serialVersionUID = -5820772575483504339L; /** - * The comparator to use when comparing two non-null objects. + * The comparator to use when comparing two non-{@code null} objects. **/ private final Comparator nonNullComparator; /** - * Specifies whether a null are compared as higher than - * non-null objects. + * Specifies whether a {@code null} are compared as higher than + * non-{@code null} objects. **/ private final boolean nullsAreHigh; //----------------------------------------------------------------------- /** - * Construct an instance that sorts null higher than any - * non-null object it is compared with. When comparing two - * non-null objects, the {@link ComparableComparator} is + * Construct an instance that sorts {@code null} higher than any + * non-{@code null} object it is compared with. When comparing two + * non-{@code null} objects, the {@link ComparableComparator} is * used. **/ public NullComparator() { @@ -57,56 +57,56 @@ public class NullComparator implements Comparator, Serializable { } /** - * Construct an instance that sorts null higher than any - * non-null object it is compared with. When comparing two - * non-null objects, the specified {@link Comparator} is + * Construct an instance that sorts {@code null} higher than any + * non-{@code null} object it is compared with. When comparing two + * non-{@code null} objects, the specified {@link Comparator} is * used. * * @param nonNullComparator the comparator to use when comparing two - * non-null objects. This argument cannot be - * null + * non-{@code null} objects. This argument cannot be + * {@code null} * - * @throws NullPointerException if nonNullComparator is - * null + * @throws NullPointerException if {@code nonNullComparator} is + * {@code null} **/ public NullComparator(final Comparator nonNullComparator) { this(nonNullComparator, true); } /** - * Construct an instance that sorts null higher or lower than - * any non-null object it is compared with. When comparing - * two non-null objects, the {@link ComparableComparator} is + * Construct an instance that sorts {@code null} higher or lower than + * any non-{@code null} object it is compared with. When comparing + * two non-{@code null} objects, the {@link ComparableComparator} is * used. * - * @param nullsAreHigh a true value indicates that - * null should be compared as higher than a - * non-null object. A false value indicates - * that null should be compared as lower than a - * non-null object. + * @param nullsAreHigh a {@code true} value indicates that + * {@code null} should be compared as higher than a + * non-{@code null} object. A {@code false} value indicates + * that {@code null} should be compared as lower than a + * non-{@code null} object. **/ public NullComparator(final boolean nullsAreHigh) { this(ComparatorUtils.NATURAL_COMPARATOR, nullsAreHigh); } /** - * Construct an instance that sorts null higher or lower than - * any non-null object it is compared with. When comparing - * two non-null objects, the specified {@link Comparator} is + * Construct an instance that sorts {@code null} higher or lower than + * any non-{@code null} object it is compared with. When comparing + * two non-{@code null} objects, the specified {@link Comparator} is * used. * * @param nonNullComparator the comparator to use when comparing two - * non-null objects. This argument cannot be - * null + * non-{@code null} objects. This argument cannot be + * {@code null} * - * @param nullsAreHigh a true value indicates that - * null should be compared as higher than a - * non-null object. A false value indicates - * that null should be compared as lower than a - * non-null object. + * @param nullsAreHigh a {@code true} value indicates that + * {@code null} should be compared as higher than a + * non-{@code null} object. A {@code false} value indicates + * that {@code null} should be compared as lower than a + * non-{@code null} object. * - * @throws NullPointerException if nonNullComparator is - * null + * @throws NullPointerException if {@code nonNullComparator} is + * {@code null} **/ public NullComparator(final Comparator nonNullComparator, final boolean nullsAreHigh) { this.nonNullComparator = Objects.requireNonNull(nonNullComparator, "nonNullComparator"); @@ -116,19 +116,19 @@ public class NullComparator implements Comparator, Serializable { //----------------------------------------------------------------------- /** * Perform a comparison between two objects. If both objects are - * null, a 0 value is returned. If one object - * is null and the other is not, the result is determined on + * {@code null}, a {@code 0} value is returned. If one object + * is {@code null} and the other is not, the result is determined on * whether the Comparator was constructed to have nulls as higher or lower - * than other objects. If neither object is null, an + * than other objects. If neither object is {@code null}, an * underlying comparator specified in the constructor (or the default) is - * used to compare the non-null objects. + * used to compare the non-{@code null} objects. * * @param o1 the first object to compare * @param o2 the object to compare it to. - * @return -1 if o1 is "lower" than (less than, - * before, etc.) o2; 1 if o1 is - * "higher" than (greater than, after, etc.) o2; or - * 0 if o1 and o2 are equal. + * @return {@code -1} if {@code o1} is "lower" than (less than, + * before, etc.) {@code o2}; {@code 1} if {@code o1} is + * "higher" than (greater than, after, etc.) {@code o2}; or + * {@code 0} if {@code o1} and {@code o2} are equal. **/ @Override public int compare(final E o1, final E o2) { @@ -156,10 +156,10 @@ public class NullComparator implements Comparator, Serializable { * * @param obj the object to compare this comparator with. * - * @return true if the specified object is a NullComparator - * with equivalent null comparison behavior - * (i.e. null high or low) and with equivalent underlying - * non-null object comparators. + * @return {@code true} if the specified object is a NullComparator + * with equivalent {@code null} comparison behavior + * (i.e. {@code null} high or low) and with equivalent underlying + * non-{@code null} object comparators. **/ @Override public boolean equals(final Object obj) { diff --git a/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java b/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java index 77cf67c92..f9a368da4 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java +++ b/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java @@ -53,7 +53,7 @@ public class ReverseComparator implements Comparator, Serializable { /** * Creates a comparator that inverts the comparison - * of the given comparator. If you pass in null, + * of the given comparator. If you pass in {@code null}, * the ReverseComparator defaults to reversing the * natural order, as per {@link java.util.Collections#reverseOrder()}. * @@ -90,13 +90,13 @@ public class ReverseComparator implements Comparator, Serializable { } /** - * Returns true iff that Object is + * Returns {@code true} iff that Object is * is a {@link Comparator} whose ordering is known to be * equivalent to mine. *

        - * This implementation returns true - * iff object.{@link Object#getClass() getClass()} - * equals this.getClass(), and the underlying + * This implementation returns {@code true} + * iff {@code object.{@link Object#getClass() getClass()}} + * equals {@code this.getClass()}, and the underlying * comparators are equal. * Subclasses may want to override this behavior to remain consistent * with the {@link Comparator#equals(Object) equals} contract. diff --git a/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java b/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java index 3d5ec908c..41a75cba5 100644 --- a/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java +++ b/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java @@ -53,7 +53,7 @@ public class TransformingComparator implements Comparator, Serializable * Constructs an instance with the given Transformer and a * {@link ComparableComparator ComparableComparator}. * - * @param transformer what will transform the arguments to compare + * @param transformer what will transform the arguments to {@code compare} */ public TransformingComparator(final Transformer transformer) { this(transformer, ComparatorUtils.NATURAL_COMPARATOR); @@ -62,7 +62,7 @@ public class TransformingComparator implements Comparator, Serializable /** * Constructs an instance with the given Transformer and Comparator. * - * @param transformer what will transform the arguments to compare + * @param transformer what will transform the arguments to {@code compare} * @param decorated the decorated Comparator */ public TransformingComparator(final Transformer transformer, @@ -102,12 +102,12 @@ public class TransformingComparator implements Comparator, Serializable } /** - * Returns true iff that Object is + * Returns {@code true} iff that Object is * is a {@link Comparator} whose ordering is known to be * equivalent to mine. *

        - * This implementation returns true - * iff that is a {@link TransformingComparator} + * This implementation returns {@code true} + * iff {@code that} is a {@link TransformingComparator} * whose attributes are equal to mine. * * @param object the object to compare to diff --git a/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java index dc66f4183..92cd3a070 100644 --- a/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/AllPredicate.java @@ -48,7 +48,7 @@ public final class AllPredicate extends AbstractQuantifierPredicate { * * @param the type that the predicate queries * @param predicates the predicates to check, cloned, not null - * @return the all predicate + * @return the {@code all} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null */ @@ -72,7 +72,7 @@ public final class AllPredicate extends AbstractQuantifierPredicate { * * @param the type that the predicate queries * @param predicates the predicates to check, cloned, not null - * @return the all predicate + * @return the {@code all} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null */ @@ -89,7 +89,7 @@ public final class AllPredicate extends AbstractQuantifierPredicate { /** * Constructor that performs no validation. - * Use allPredicate if you want that. + * Use {@code allPredicate} if you want that. * * @param predicates the predicates to check, not cloned, not null */ diff --git a/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java index b53c59c9e..0c14cf228 100644 --- a/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/AndPredicate.java @@ -42,7 +42,7 @@ public final class AndPredicate implements PredicateDecorator, Serializabl * @param the type that the predicate queries * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null - * @return the and predicate + * @return the {@code and} predicate * @throws NullPointerException if either predicate is null */ public static Predicate andPredicate(final Predicate predicate1, @@ -53,7 +53,7 @@ public final class AndPredicate implements PredicateDecorator, Serializabl /** * Constructor that performs no validation. - * Use andPredicate if you want that. + * Use {@code andPredicate} if you want that. * * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null diff --git a/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java b/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java index e73580035..19679c1d9 100644 --- a/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/AnyPredicate.java @@ -44,7 +44,7 @@ public final class AnyPredicate extends AbstractQuantifierPredicate { * * @param the type that the predicate queries * @param predicates the predicates to check, cloned, not null - * @return the any predicate + * @return the {@code any} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null */ @@ -68,7 +68,7 @@ public final class AnyPredicate extends AbstractQuantifierPredicate { * * @param the type that the predicate queries * @param predicates the predicates to check, cloned, not null - * @return the all predicate + * @return the {@code all} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null */ @@ -86,7 +86,7 @@ public final class AnyPredicate extends AbstractQuantifierPredicate { /** * Constructor that performs no validation. - * Use anyPredicate if you want that. + * Use {@code anyPredicate} if you want that. * * @param predicates the predicates to check, not cloned, not null */ diff --git a/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java b/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java index 235e7c924..94a360e4b 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/ChainedClosure.java @@ -40,7 +40,7 @@ public class ChainedClosure implements Closure, Serializable { * * @param the type that the closure acts on * @param closures the closures to chain, copied, no nulls - * @return the chained closure + * @return the {@code chained} closure * @throws NullPointerException if the closures array is null * @throws NullPointerException if any closure in the array is null */ @@ -59,7 +59,7 @@ public class ChainedClosure implements Closure, Serializable { * * @param the type that the closure acts on * @param closures a collection of closures to chain - * @return the chained closure + * @return the {@code chained} closure * @throws NullPointerException if the closures collection is null * @throws NullPointerException if any closure in the collection is null */ @@ -92,7 +92,7 @@ public class ChainedClosure implements Closure, Serializable { /** * Constructor that performs no validation. - * Use chainedClosure if you want that. + * Use {@code chainedClosure} if you want that. * * @param closures the closures to chain, copied, no nulls */ diff --git a/src/main/java/org/apache/commons/collections4/functors/ChainedTransformer.java b/src/main/java/org/apache/commons/collections4/functors/ChainedTransformer.java index 34368c523..28ab87502 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ChainedTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/ChainedTransformer.java @@ -44,7 +44,7 @@ public class ChainedTransformer implements Transformer, Serializable { * * @param the object type * @param transformers the transformers to chain, copied, no nulls - * @return the chained transformer + * @return the {@code chained} transformer * @throws NullPointerException if the transformers array is null * @throws NullPointerException if any transformer in the array is null */ @@ -63,7 +63,7 @@ public class ChainedTransformer implements Transformer, Serializable { * * @param the object type * @param transformers a collection of transformers to chain - * @return the chained transformer + * @return the {@code chained} transformer * @throws NullPointerException if the transformers collection is null * @throws NullPointerException if any transformer in the collection is null */ @@ -92,7 +92,7 @@ public class ChainedTransformer implements Transformer, Serializable { /** * Constructor that performs no validation. - * Use chainedTransformer if you want that. + * Use {@code chainedTransformer} if you want that. * * @param transformers the transformers to chain, copied, no nulls */ diff --git a/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java b/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java index a01eba062..6775b1a90 100644 --- a/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/CloneTransformer.java @@ -21,7 +21,7 @@ import org.apache.commons.collections4.Transformer; /** * Transformer implementation that returns a clone of the input object. *

        - * Clone is performed using PrototypeFactory.prototypeFactory(input).create(). + * Clone is performed using {@code PrototypeFactory.prototypeFactory(input).create()}. *

        *

        * WARNING: from v4.1 onwards this class will not be serializable anymore diff --git a/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java b/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java index 91c1c34f8..8ab9f8f22 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/ClosureTransformer.java @@ -41,7 +41,7 @@ public class ClosureTransformer implements Transformer, Serializable { * * @param the type of the object to transform * @param closure the closure to call, not null - * @return the closure transformer + * @return the {@code closure} transformer * @throws NullPointerException if the closure is null */ public static Transformer closureTransformer(final Closure closure) { @@ -50,7 +50,7 @@ public class ClosureTransformer implements Transformer, Serializable { /** * Constructor that performs no validation. - * Use closureTransformer if you want that. + * Use {@code closureTransformer} if you want that. * * @param closure the closure to call, not null */ diff --git a/src/main/java/org/apache/commons/collections4/functors/ComparatorPredicate.java b/src/main/java/org/apache/commons/collections4/functors/ComparatorPredicate.java index 7f1793328..17ef0bd35 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ComparatorPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/ComparatorPredicate.java @@ -41,16 +41,16 @@ import org.apache.commons.collections4.Predicate; * }; * * - *

        Using the declared variables, the ComparatorPredicate can be used used in the + *

        Using the declared variables, the {@code ComparatorPredicate} can be used used in the * following way:

        * *
          * ComparatorPredicate.comparatorPredicate(ONE, comparator).evaluate(TWO);
          * 
        * - *

        The input variable TWO in compared to the stored variable ONE using - * the supplied comparator. This is the default usage of the predicate and will return - * true if the underlying comparator returns 0. In addition to the default + *

        The input variable {@code TWO} in compared to the stored variable {@code ONE} using + * the supplied {@code comparator}. This is the default usage of the predicate and will return + * {@code true} if the underlying comparator returns {@code 0}. In addition to the default * usage of the predicate, it is possible to evaluate the comparator's result in several ways. The * following {@link Criterion} enumeration values are provided by the predicate: *

        @@ -70,9 +70,9 @@ import org.apache.commons.collections4.Predicate; * ComparatorPredicate.comparatorPredicate(ONE, comparator,ComparatorPredicate.Criterion.GREATER).evaluate(TWO); * * - *

        The input variable TWO is compared to the stored variable ONE using the supplied comparator - * using the GREATER evaluation criterion constant. This instructs the predicate to - * return true if the comparator returns a value greater than 0.

        + *

        The input variable TWO is compared to the stored variable ONE using the supplied {@code comparator} + * using the {@code GREATER} evaluation criterion constant. This instructs the predicate to + * return {@code true} if the comparator returns a value greater than {@code 0}.

        * * @since 4.0 */ @@ -126,7 +126,7 @@ public class ComparatorPredicate implements Predicate, Serializable { /** * Constructor that performs no validation. - * Use comparatorPredicate if you want that. + * Use {@code comparatorPredicate} if you want that. * * @param object the object to compare to * @param comparator the comparator to use for comparison @@ -140,14 +140,14 @@ public class ComparatorPredicate implements Predicate, Serializable { } /** - * Evaluates the predicate. The predicate evaluates to true in the following cases: + * Evaluates the predicate. The predicate evaluates to {@code true} in the following cases: * *
          - *
        • comparator.compare(object, input) == 0 && criterion == EQUAL
        • - *
        • comparator.compare(object, input) < 0 && criterion == LESS
        • - *
        • comparator.compare(object, input) > 0 && criterion == GREATER
        • - *
        • comparator.compare(object, input) >= 0 && criterion == GREATER_OR_EQUAL
        • - *
        • comparator.compare(object, input) <= 0 && criterion == LESS_OR_EQUAL
        • + *
        • {@code comparator.compare(object, input) == 0 && criterion == EQUAL}
        • + *
        • {@code comparator.compare(object, input) < 0 && criterion == LESS}
        • + *
        • {@code comparator.compare(object, input) > 0 && criterion == GREATER}
        • + *
        • {@code comparator.compare(object, input) >= 0 && criterion == GREATER_OR_EQUAL}
        • + *
        • {@code comparator.compare(object, input) <= 0 && criterion == LESS_OR_EQUAL}
        • *
        * * @see org.apache.commons.collections4.Predicate#evaluate(java.lang.Object) diff --git a/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java b/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java index b915ee475..a033bc030 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java +++ b/src/main/java/org/apache/commons/collections4/functors/ConstantFactory.java @@ -47,7 +47,7 @@ public class ConstantFactory implements Factory, Serializable { * * @param the type of the constant * @param constantToReturn the constant object to return each time in the factory - * @return the constant factory. + * @return the {@code constant} factory. */ public static Factory constantFactory(final T constantToReturn) { if (constantToReturn == null) { @@ -58,7 +58,7 @@ public class ConstantFactory implements Factory, Serializable { /** * Constructor that performs no validation. - * Use constantFactory if you want that. + * Use {@code constantFactory} if you want that. * * @param constantToReturn the constant to return each time */ diff --git a/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java b/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java index dd33e4724..cf1eb0486 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/ConstantTransformer.java @@ -59,7 +59,7 @@ public class ConstantTransformer implements Transformer, Serializabl * @param the input type * @param the output type * @param constantToReturn the constant object to return each time in the factory - * @return the constant factory. + * @return the {@code constant} factory. */ public static Transformer constantTransformer(final O constantToReturn) { if (constantToReturn == null) { @@ -70,7 +70,7 @@ public class ConstantTransformer implements Transformer, Serializabl /** * Constructor that performs no validation. - * Use constantTransformer if you want that. + * Use {@code constantTransformer} if you want that. * * @param constantToReturn the constant to return each time */ diff --git a/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java b/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java index c2d719db4..4149658fe 100644 --- a/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java +++ b/src/main/java/org/apache/commons/collections4/functors/DefaultEquator.java @@ -36,7 +36,7 @@ public class DefaultEquator implements Equator, Serializable { public static final DefaultEquator INSTANCE = new DefaultEquator<>(); /** - * Hashcode used for null objects. + * Hashcode used for {@code null} objects. */ public static final int HASHCODE_NULL = -1; @@ -68,8 +68,8 @@ public class DefaultEquator implements Equator, Serializable { /** * {@inheritDoc} * - * @return o.hashCode() if o is non- - * null, else {@link #HASHCODE_NULL}. + * @return {@code o.hashCode()} if {@code o} is non- + * {@code null}, else {@link #HASHCODE_NULL}. */ @Override public int hash(final T o) { diff --git a/src/main/java/org/apache/commons/collections4/functors/EqualPredicate.java b/src/main/java/org/apache/commons/collections4/functors/EqualPredicate.java index 90ed03757..b7ca4be26 100644 --- a/src/main/java/org/apache/commons/collections4/functors/EqualPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/EqualPredicate.java @@ -70,7 +70,7 @@ public final class EqualPredicate implements Predicate, Serializable { /** * Constructor that performs no validation. - * Use equalPredicate if you want that. + * Use {@code equalPredicate} if you want that. * * @param object the object to compare to */ @@ -82,7 +82,7 @@ public final class EqualPredicate implements Predicate, Serializable { /** * Constructor that performs no validation. - * Use equalPredicate if you want that. + * Use {@code equalPredicate} if you want that. * * @param object the object to compare to * @param equator the equator to use for comparison diff --git a/src/main/java/org/apache/commons/collections4/functors/FactoryTransformer.java b/src/main/java/org/apache/commons/collections4/functors/FactoryTransformer.java index 53a465f66..a6feef76e 100644 --- a/src/main/java/org/apache/commons/collections4/functors/FactoryTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/FactoryTransformer.java @@ -41,7 +41,7 @@ public class FactoryTransformer implements Transformer, Serializable * @param the input type * @param the output type * @param factory the factory to call, not null - * @return the factory transformer + * @return the {@code factory} transformer * @throws NullPointerException if the factory is null */ public static Transformer factoryTransformer(final Factory factory) { @@ -50,7 +50,7 @@ public class FactoryTransformer implements Transformer, Serializable /** * Constructor that performs no validation. - * Use factoryTransformer if you want that. + * Use {@code factoryTransformer} if you want that. * * @param factory the factory to call, not null */ diff --git a/src/main/java/org/apache/commons/collections4/functors/ForClosure.java b/src/main/java/org/apache/commons/collections4/functors/ForClosure.java index 0055af591..f4a723522 100644 --- a/src/main/java/org/apache/commons/collections4/functors/ForClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/ForClosure.java @@ -39,13 +39,13 @@ public class ForClosure implements Closure { /** * Factory method that performs validation. *

        - * A null closure or zero count returns the NOPClosure. + * A null closure or zero count returns the {@code NOPClosure}. * A count of one returns the specified closure. * * @param the type that the closure acts on * @param count the number of times to execute the closure * @param closure the closure to execute, not null - * @return the for closure + * @return the {@code for} closure */ @SuppressWarnings("unchecked") public static Closure forClosure(final int count, final Closure closure) { @@ -60,7 +60,7 @@ public class ForClosure implements Closure { /** * Constructor that performs no validation. - * Use forClosure if you want that. + * Use {@code forClosure} if you want that. * * @param count the number of times to execute the closure * @param closure the closure to execute, not null @@ -72,7 +72,7 @@ public class ForClosure implements Closure { } /** - * Executes the closure count times. + * Executes the closure {@code count} times. * * @param input the input object */ diff --git a/src/main/java/org/apache/commons/collections4/functors/IdentityPredicate.java b/src/main/java/org/apache/commons/collections4/functors/IdentityPredicate.java index 2687c1499..eb203001b 100644 --- a/src/main/java/org/apache/commons/collections4/functors/IdentityPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/IdentityPredicate.java @@ -50,7 +50,7 @@ public final class IdentityPredicate implements Predicate, Serializable { /** * Constructor that performs no validation. - * Use identityPredicate if you want that. + * Use {@code identityPredicate} if you want that. * * @param object the object to compare to */ diff --git a/src/main/java/org/apache/commons/collections4/functors/IfClosure.java b/src/main/java/org/apache/commons/collections4/functors/IfClosure.java index 0d8e59c45..6fd714670 100644 --- a/src/main/java/org/apache/commons/collections4/functors/IfClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/IfClosure.java @@ -49,7 +49,7 @@ public class IfClosure implements Closure, Serializable { * @param the type that the closure acts on * @param predicate predicate to switch on * @param trueClosure closure used if true - * @return the if closure + * @return the {@code if} closure * @throws NullPointerException if either argument is null * @since 3.2 */ @@ -64,7 +64,7 @@ public class IfClosure implements Closure, Serializable { * @param predicate predicate to switch on * @param trueClosure closure used if true * @param falseClosure closure used if false - * @return the if closure + * @return the {@code if} closure * @throws NullPointerException if any argument is null */ public static Closure ifClosure(final Predicate predicate, @@ -77,7 +77,7 @@ public class IfClosure implements Closure, Serializable { /** * Constructor that performs no validation. - * Use ifClosure if you want that. + * Use {@code ifClosure} if you want that. *

        * This constructor creates a closure that performs no action when * the predicate is false. @@ -92,7 +92,7 @@ public class IfClosure implements Closure, Serializable { /** * Constructor that performs no validation. - * Use ifClosure if you want that. + * Use {@code ifClosure} if you want that. * * @param predicate predicate to switch on, not null * @param trueClosure closure used if true, not null diff --git a/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java b/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java index 37bd67ad4..f9e7911e2 100644 --- a/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/IfTransformer.java @@ -51,7 +51,7 @@ public class IfTransformer implements Transformer, Serializable { * @param predicate predicate to switch on * @param trueTransformer transformer used if true * @param falseTransformer transformer used if false - * @return the if transformer + * @return the {@code if} transformer * @throws NullPointerException if either argument is null */ public static Transformer ifTransformer(final Predicate predicate, @@ -71,7 +71,7 @@ public class IfTransformer implements Transformer, Serializable { * @param input and output type for the transformer * @param predicate predicate to switch on * @param trueTransformer transformer used if true - * @return the if transformer + * @return the {@code if} transformer * @throws NullPointerException if either argument is null */ public static Transformer ifTransformer( @@ -83,7 +83,7 @@ public class IfTransformer implements Transformer, Serializable { /** * Constructor that performs no validation. - * Use the static factory method ifTransformer if you want that. + * Use the static factory method {@code ifTransformer} if you want that. * * @param predicate predicate to switch on, not null * @param trueTransformer transformer used if true, not null diff --git a/src/main/java/org/apache/commons/collections4/functors/InstanceofPredicate.java b/src/main/java/org/apache/commons/collections4/functors/InstanceofPredicate.java index 3a1c7a7a8..991dd0f9b 100644 --- a/src/main/java/org/apache/commons/collections4/functors/InstanceofPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/InstanceofPredicate.java @@ -48,7 +48,7 @@ public final class InstanceofPredicate implements Predicate, Serializabl /** * Constructor that performs no validation. - * Use instanceOfPredicate if you want that. + * Use {@code instanceOfPredicate} if you want that. * * @param type the type to check for */ diff --git a/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java b/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java index 7cbb45600..23c4612bf 100644 --- a/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java +++ b/src/main/java/org/apache/commons/collections4/functors/InstantiateFactory.java @@ -74,7 +74,7 @@ public class InstantiateFactory implements Factory { /** * Constructor that performs no validation. - * Use instantiateFactory if you want that. + * Use {@code instantiateFactory} if you want that. * * @param classToInstantiate the class to instantiate */ @@ -88,7 +88,7 @@ public class InstantiateFactory implements Factory { /** * Constructor that performs no validation. - * Use instantiateFactory if you want that. + * Use {@code instantiateFactory} if you want that. * * @param classToInstantiate the class to instantiate * @param paramTypes the constructor parameter types, cloned diff --git a/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java b/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java index 7ae7246ed..cd419a96e 100644 --- a/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/InstantiateTransformer.java @@ -88,7 +88,7 @@ public class InstantiateTransformer implements Transformer /** * Constructor that performs no validation. - * Use instantiateTransformer if you want that. + * Use {@code instantiateTransformer} if you want that. *

        * Note: from 4.0, the input parameters will be cloned * diff --git a/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java b/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java index d15d3ec15..293f808d8 100644 --- a/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/InvokerTransformer.java @@ -97,7 +97,7 @@ public class InvokerTransformer implements Transformer { /** * Constructor that performs no validation. - * Use invokerTransformer if you want that. + * Use {@code invokerTransformer} if you want that. *

        * Note: from 4.0, the input parameters will be cloned * diff --git a/src/main/java/org/apache/commons/collections4/functors/MapTransformer.java b/src/main/java/org/apache/commons/collections4/functors/MapTransformer.java index 7e9b75aa1..01f16fac0 100644 --- a/src/main/java/org/apache/commons/collections4/functors/MapTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/MapTransformer.java @@ -54,7 +54,7 @@ public final class MapTransformer implements Transformer, Serializab /** * Constructor that performs no validation. - * Use mapTransformer if you want that. + * Use {@code mapTransformer} if you want that. * * @param map the map to use for lookup, not cloned */ @@ -64,7 +64,7 @@ public final class MapTransformer implements Transformer, Serializab } /** - * Transforms the input to result by looking it up in a Map. + * Transforms the input to result by looking it up in a {@code Map}. * * @param input the input object to transform * @return the transformed result diff --git a/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java b/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java index bf5cae1a0..6de6e8d22 100644 --- a/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/NonePredicate.java @@ -43,7 +43,7 @@ public final class NonePredicate extends AbstractQuantifierPredicate { * * @param the type that the predicate queries * @param predicates the predicates to check, cloned, not null - * @return the any predicate + * @return the {@code any} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null */ @@ -62,7 +62,7 @@ public final class NonePredicate extends AbstractQuantifierPredicate { * * @param the type that the predicate queries * @param predicates the predicates to check, cloned, not null - * @return the one predicate + * @return the {@code one} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null */ @@ -76,7 +76,7 @@ public final class NonePredicate extends AbstractQuantifierPredicate { /** * Constructor that performs no validation. - * Use nonePredicate if you want that. + * Use {@code nonePredicate} if you want that. * * @param predicates the predicates to check, not cloned, not null */ diff --git a/src/main/java/org/apache/commons/collections4/functors/NotPredicate.java b/src/main/java/org/apache/commons/collections4/functors/NotPredicate.java index bc569174d..77f36d6c6 100644 --- a/src/main/java/org/apache/commons/collections4/functors/NotPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/NotPredicate.java @@ -48,7 +48,7 @@ public final class NotPredicate implements PredicateDecorator, Serializabl /** * Constructor that performs no validation. - * Use notPredicate if you want that. + * Use {@code notPredicate} if you want that. * * @param predicate the predicate to call after the null check */ diff --git a/src/main/java/org/apache/commons/collections4/functors/NullIsExceptionPredicate.java b/src/main/java/org/apache/commons/collections4/functors/NullIsExceptionPredicate.java index 875c2467d..4f90dd35d 100644 --- a/src/main/java/org/apache/commons/collections4/functors/NullIsExceptionPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/NullIsExceptionPredicate.java @@ -49,7 +49,7 @@ public final class NullIsExceptionPredicate implements PredicateDecorator, /** * Constructor that performs no validation. - * Use nullIsExceptionPredicate if you want that. + * Use {@code nullIsExceptionPredicate} if you want that. * * @param predicate the predicate to call after the null check */ diff --git a/src/main/java/org/apache/commons/collections4/functors/NullIsFalsePredicate.java b/src/main/java/org/apache/commons/collections4/functors/NullIsFalsePredicate.java index 1ee6c9d49..f52038acb 100644 --- a/src/main/java/org/apache/commons/collections4/functors/NullIsFalsePredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/NullIsFalsePredicate.java @@ -48,7 +48,7 @@ public final class NullIsFalsePredicate implements PredicateDecorator, Ser /** * Constructor that performs no validation. - * Use nullIsFalsePredicate if you want that. + * Use {@code nullIsFalsePredicate} if you want that. * * @param predicate the predicate to call after the null check */ diff --git a/src/main/java/org/apache/commons/collections4/functors/NullIsTruePredicate.java b/src/main/java/org/apache/commons/collections4/functors/NullIsTruePredicate.java index a86ee5fa9..028455c91 100644 --- a/src/main/java/org/apache/commons/collections4/functors/NullIsTruePredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/NullIsTruePredicate.java @@ -48,7 +48,7 @@ public final class NullIsTruePredicate implements PredicateDecorator, Seri /** * Constructor that performs no validation. - * Use nullIsTruePredicate if you want that. + * Use {@code nullIsTruePredicate} if you want that. * * @param predicate the predicate to call after the null check */ diff --git a/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java b/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java index d565fc0e7..3ff773ca5 100644 --- a/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/OnePredicate.java @@ -44,7 +44,7 @@ public final class OnePredicate extends AbstractQuantifierPredicate { * * @param the type that the predicate queries * @param predicates the predicates to check, cloned, not null - * @return the any predicate + * @return the {@code any} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null */ @@ -65,7 +65,7 @@ public final class OnePredicate extends AbstractQuantifierPredicate { * * @param the type that the predicate queries * @param predicates the predicates to check, cloned, not null - * @return the one predicate + * @return the {@code one} predicate * @throws NullPointerException if the predicates array is null * @throws NullPointerException if any predicate in the array is null */ @@ -76,7 +76,7 @@ public final class OnePredicate extends AbstractQuantifierPredicate { /** * Constructor that performs no validation. - * Use onePredicate if you want that. + * Use {@code onePredicate} if you want that. * * @param predicates the predicates to check, not cloned, not null */ diff --git a/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java b/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java index 9a6bda4be..c2642b60d 100644 --- a/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/OrPredicate.java @@ -42,7 +42,7 @@ public final class OrPredicate implements PredicateDecorator, Serializable * @param the type that the predicate queries * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null - * @return the and predicate + * @return the {@code and} predicate * @throws NullPointerException if either predicate is null */ public static Predicate orPredicate(final Predicate predicate1, @@ -53,7 +53,7 @@ public final class OrPredicate implements PredicateDecorator, Serializable /** * Constructor that performs no validation. - * Use orPredicate if you want that. + * Use {@code orPredicate} if you want that. * * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null diff --git a/src/main/java/org/apache/commons/collections4/functors/PredicateTransformer.java b/src/main/java/org/apache/commons/collections4/functors/PredicateTransformer.java index 3c4153479..e7c81adc2 100644 --- a/src/main/java/org/apache/commons/collections4/functors/PredicateTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/PredicateTransformer.java @@ -40,7 +40,7 @@ public class PredicateTransformer implements Transformer, Seriali * * @param the input type * @param predicate the predicate to call, not null - * @return the predicate transformer + * @return the {@code predicate} transformer * @throws IllegalArgumentException if the predicate is null */ public static Transformer predicateTransformer(final Predicate predicate) { @@ -52,7 +52,7 @@ public class PredicateTransformer implements Transformer, Seriali /** * Constructor that performs no validation. - * Use predicateTransformer if you want that. + * Use {@code predicateTransformer} if you want that. * * @param predicate the predicate to call, not null */ diff --git a/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java b/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java index f87b0d9ec..20045afd2 100644 --- a/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java +++ b/src/main/java/org/apache/commons/collections4/functors/PrototypeFactory.java @@ -58,7 +58,7 @@ public class PrototypeFactory { * * @param the type the factory creates * @param prototype the object to clone each time in the factory - * @return the prototype factory, or a {@link ConstantFactory#NULL_INSTANCE} if + * @return the {@code prototype} factory, or a {@link ConstantFactory#NULL_INSTANCE} if * the {@code prototype} is {@code null} * @throws IllegalArgumentException if the prototype cannot be cloned */ diff --git a/src/main/java/org/apache/commons/collections4/functors/StringValueTransformer.java b/src/main/java/org/apache/commons/collections4/functors/StringValueTransformer.java index 46e903366..1b096dc9b 100644 --- a/src/main/java/org/apache/commons/collections4/functors/StringValueTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/StringValueTransformer.java @@ -22,7 +22,7 @@ import org.apache.commons.collections4.Transformer; /** * Transformer implementation that returns the result of calling - * String.valueOf on the input object. + * {@code String.valueOf} on the input object. * * @since 3.0 */ @@ -54,7 +54,7 @@ public final class StringValueTransformer implements Transformer, } /** - * Transforms the input to result by calling String.valueOf. + * Transforms the input to result by calling {@code String.valueOf}. * * @param input the input object to transform * @return the transformed result diff --git a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java index 76a507f75..71955c769 100644 --- a/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/SwitchClosure.java @@ -48,7 +48,7 @@ public class SwitchClosure implements Closure, Serializable { * @param predicates array of predicates, cloned, no nulls * @param closures matching array of closures, cloned, no nulls * @param defaultClosure the closure to use if no match, null means nop - * @return the chained closure + * @return the {@code chained} closure * @throws NullPointerException if array is null * @throws NullPointerException if any element in the array is null * @throws IllegalArgumentException if the array lengths of predicates and closures do not match @@ -81,7 +81,7 @@ public class SwitchClosure implements Closure, Serializable { * * @param the type that the closure acts on * @param predicatesAndClosures a map of predicates to closures - * @return the switch closure + * @return the {@code switch} closure * @throws NullPointerException if the map is null * @throws NullPointerException if any closure in the map is null * @throws ClassCastException if the map elements are of the wrong type @@ -125,7 +125,7 @@ public class SwitchClosure implements Closure, Serializable { /** * Constructor that performs no validation. - * Use switchClosure if you want that. + * Use {@code switchClosure} if you want that. * * @param predicates array of predicates, cloned, no nulls * @param closures matching array of closures, cloned, no nulls diff --git a/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java b/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java index 3c759f647..205b75e03 100644 --- a/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java +++ b/src/main/java/org/apache/commons/collections4/functors/SwitchTransformer.java @@ -49,7 +49,7 @@ public class SwitchTransformer implements Transformer, Serializable * @param predicates array of predicates, cloned, no nulls * @param transformers matching array of transformers, cloned, no nulls * @param defaultTransformer the transformer to use if no match, null means return null - * @return the chained transformer + * @return the {@code chained} transformer * @throws NullPointerException if either array is null * @throws NullPointerException if any element in the arrays is null * @throws IllegalArgumentException if the arrays have different sizes @@ -84,7 +84,7 @@ public class SwitchTransformer implements Transformer, Serializable * @param the input type * @param the output type * @param map a map of predicates to transformers - * @return the switch transformer + * @return the {@code switch} transformer * @throws NullPointerException if the map is null * @throws NullPointerException if any transformer in the map is null * @throws ClassCastException if the map elements are of the wrong type @@ -137,7 +137,7 @@ public class SwitchTransformer implements Transformer, Serializable /** * Constructor that performs no validation. - * Use switchTransformer if you want that. + * Use {@code switchTransformer} if you want that. * * @param predicates array of predicates, cloned, no nulls * @param transformers matching array of transformers, cloned, no nulls diff --git a/src/main/java/org/apache/commons/collections4/functors/TransformedPredicate.java b/src/main/java/org/apache/commons/collections4/functors/TransformedPredicate.java index 2a4e697bd..1836b68e3 100644 --- a/src/main/java/org/apache/commons/collections4/functors/TransformedPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/TransformedPredicate.java @@ -24,7 +24,7 @@ import org.apache.commons.collections4.Transformer; /** * Predicate implementation that transforms the given object before invoking - * another Predicate. + * another {@code Predicate}. * * @since 3.1 */ @@ -56,7 +56,7 @@ public final class TransformedPredicate implements PredicateDecorator, Ser /** * Constructor that performs no validation. - * Use transformedPredicate if you want that. + * Use {@code transformedPredicate} if you want that. * * @param transformer the transformer to use * @param predicate the predicate to decorate diff --git a/src/main/java/org/apache/commons/collections4/functors/TransformerClosure.java b/src/main/java/org/apache/commons/collections4/functors/TransformerClosure.java index 31cc738ff..3c6e947d5 100644 --- a/src/main/java/org/apache/commons/collections4/functors/TransformerClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/TransformerClosure.java @@ -38,11 +38,11 @@ public class TransformerClosure implements Closure, Serializable { /** * Factory method that performs validation. *

        - * A null transformer will return the NOPClosure. + * A null transformer will return the {@code NOPClosure}. * * @param the type that the closure acts on * @param transformer the transformer to call, null means nop - * @return the transformer closure + * @return the {@code transformer} closure */ public static Closure transformerClosure(final Transformer transformer) { if (transformer == null) { @@ -53,7 +53,7 @@ public class TransformerClosure implements Closure, Serializable { /** * Constructor that performs no validation. - * Use transformerClosure if you want that. + * Use {@code transformerClosure} if you want that. * * @param transformer the transformer to call, not null */ diff --git a/src/main/java/org/apache/commons/collections4/functors/TransformerPredicate.java b/src/main/java/org/apache/commons/collections4/functors/TransformerPredicate.java index f72bfd8ab..b226180fe 100644 --- a/src/main/java/org/apache/commons/collections4/functors/TransformerPredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/TransformerPredicate.java @@ -50,7 +50,7 @@ public final class TransformerPredicate implements Predicate, Serializable /** * Constructor that performs no validation. - * Use transformerPredicate if you want that. + * Use {@code transformerPredicate} if you want that. * * @param transformer the transformer to decorate */ diff --git a/src/main/java/org/apache/commons/collections4/functors/UniquePredicate.java b/src/main/java/org/apache/commons/collections4/functors/UniquePredicate.java index 58009634b..4aaf23104 100644 --- a/src/main/java/org/apache/commons/collections4/functors/UniquePredicate.java +++ b/src/main/java/org/apache/commons/collections4/functors/UniquePredicate.java @@ -49,7 +49,7 @@ public final class UniquePredicate implements Predicate, Serializable { /** * Constructor that performs no validation. - * Use uniquePredicate if you want that. + * Use {@code uniquePredicate} if you want that. */ public UniquePredicate() { super(); diff --git a/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java b/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java index db26be28c..0700039ca 100644 --- a/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java +++ b/src/main/java/org/apache/commons/collections4/functors/WhileClosure.java @@ -49,7 +49,7 @@ public class WhileClosure implements Closure { * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once - * @return the while closure + * @return the {@code while} closure * @throws NullPointerException if the predicate or closure is null */ public static Closure whileClosure(final Predicate predicate, @@ -60,7 +60,7 @@ public class WhileClosure implements Closure { /** * Constructor that performs no validation. - * Use whileClosure if you want that. + * Use {@code whileClosure} if you want that. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null diff --git a/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java index e1b4c58a0..f3d3599a4 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ArrayIterator.java @@ -53,8 +53,8 @@ public class ArrayIterator implements ResettableIterator { * specified array. * * @param array the array to iterate over. - * @throws IllegalArgumentException if array is not an array. - * @throws NullPointerException if array is null + * @throws IllegalArgumentException if {@code array} is not an array. + * @throws NullPointerException if {@code array} is {@code null} */ public ArrayIterator(final Object array) { this(array, 0); @@ -66,8 +66,8 @@ public class ArrayIterator implements ResettableIterator { * * @param array the array to iterate over. * @param startIndex the index to start iterating at. - * @throws IllegalArgumentException if array is not an array. - * @throws NullPointerException if array is null + * @throws IllegalArgumentException if {@code array} is not an array. + * @throws NullPointerException if {@code array} is {@code null} * @throws IndexOutOfBoundsException if the index is invalid */ public ArrayIterator(final Object array, final int startIndex) { @@ -81,8 +81,8 @@ public class ArrayIterator implements ResettableIterator { * @param array the array to iterate over. * @param startIndex the index to start iterating at. * @param endIndex the index to finish iterating at. - * @throws IllegalArgumentException if array is not an array. - * @throws NullPointerException if array is null + * @throws IllegalArgumentException if {@code array} is not an array. + * @throws NullPointerException if {@code array} is {@code null} * @throws IndexOutOfBoundsException if either index is invalid */ public ArrayIterator(final Object array, final int startIndex, final int endIndex) { diff --git a/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java index 071ffaf48..d01597c9f 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ArrayListIterator.java @@ -42,9 +42,9 @@ public class ArrayListIterator extends ArrayIterator implements ResettableListIterator { /** - * Holds the index of the last item returned by a call to next() - * or previous(). This is set to -1 if neither method - * has yet been invoked. lastItemIndex is used to to implement + * Holds the index of the last item returned by a call to {@code next()} + * or {@code previous()}. This is set to {@code -1} if neither method + * has yet been invoked. {@code lastItemIndex} is used to to implement * the {@link #set} method. */ private int lastItemIndex = -1; @@ -56,8 +56,8 @@ public class ArrayListIterator extends ArrayIterator * specified array. * * @param array the array to iterate over - * @throws IllegalArgumentException if array is not an array. - * @throws NullPointerException if array is null + * @throws IllegalArgumentException if {@code array} is not an array. + * @throws NullPointerException if {@code array} is {@code null} */ public ArrayListIterator(final Object array) { super(array); @@ -69,8 +69,8 @@ public class ArrayListIterator extends ArrayIterator * * @param array the array to iterate over * @param startIndex the index to start iterating at - * @throws IllegalArgumentException if array is not an array. - * @throws NullPointerException if array is null + * @throws IllegalArgumentException if {@code array} is not an array. + * @throws NullPointerException if {@code array} is {@code null} * @throws IndexOutOfBoundsException if the start index is out of bounds */ public ArrayListIterator(final Object array, final int startIndex) { @@ -84,10 +84,10 @@ public class ArrayListIterator extends ArrayIterator * @param array the array to iterate over * @param startIndex the index to start iterating at * @param endIndex the index (exclusive) to finish iterating at - * @throws IllegalArgumentException if array is not an array. + * @throws IllegalArgumentException if {@code array} is not an array. * @throws IndexOutOfBoundsException if the start or end index is out of bounds * @throws IllegalArgumentException if end index is before the start - * @throws NullPointerException if array is null + * @throws NullPointerException if {@code array} is {@code null} */ public ArrayListIterator(final Object array, final int startIndex, final int endIndex) { super(array, startIndex, endIndex); @@ -177,10 +177,10 @@ public class ArrayListIterator extends ArrayIterator * to {@link #next()} of {@link #previous()}. *

        * Note: {@link java.util.ListIterator} implementations that support - * add() and remove() only allow set() to be called - * once per call to next() or previous (see the {@link java.util.ListIterator} + * {@code add()} and {@code remove()} only allow {@code set()} to be called + * once per call to {@code next()} or {@code previous} (see the {@link java.util.ListIterator} * javadoc for more details). Since this implementation does - * not support add() or remove(), set() may be + * not support {@code add()} or {@code remove()}, {@code set()} may be * called as often as desired. * * @param o the element to set diff --git a/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java index 960fa13ba..3d1ff4a44 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/CollatingIterator.java @@ -31,9 +31,9 @@ import org.apache.commons.collections4.list.UnmodifiableList; * Provides an ordered iteration over the elements contained in a collection of * ordered Iterators. *

        - * Given two ordered {@link Iterator} instances A and - * B, the {@link #next} method on this iterator will return the - * lesser of A.next() and B.next(). + * Given two ordered {@link Iterator} instances {@code A} and + * {@code B}, the {@link #next} method on this iterator will return the + * lesser of {@code A.next()} and {@code B.next()}. * * @since 2.1 */ @@ -60,7 +60,7 @@ public class CollatingIterator implements Iterator { // Constructors // ---------------------------------------------------------------------- /** - * Constructs a new CollatingIterator. A comparator must be + * Constructs a new {@code CollatingIterator}. A comparator must be * set by calling {@link #setComparator(Comparator)} before invoking * {@link #hasNext()}, or {@link #next()} for the first time. Child * iterators will have to be manually added using the @@ -71,7 +71,7 @@ public class CollatingIterator implements Iterator { } /** - * Constructs a new CollatingIterator that will used the + * Constructs a new {@code CollatingIterator} that will used the * specified comparator for ordering. Child iterators will have to be * manually added using the {@link #addIterator(Iterator)} method. * @@ -83,7 +83,7 @@ public class CollatingIterator implements Iterator { } /** - * Constructs a new CollatingIterator that will used the + * Constructs a new {@code CollatingIterator} that will used the * specified comparator for ordering and have the specified initial * capacity. Child iterators will have to be manually added using the * {@link #addIterator(Iterator)} method. @@ -99,7 +99,7 @@ public class CollatingIterator implements Iterator { } /** - * Constructs a new CollatingIterator that will use the + * Constructs a new {@code CollatingIterator} that will use the * specified comparator to provide ordered iteration over the two given * iterators. * @@ -117,7 +117,7 @@ public class CollatingIterator implements Iterator { } /** - * Constructs a new CollatingIterator that will use the + * Constructs a new {@code CollatingIterator} that will use the * specified comparator to provide ordered iteration over the array of * iterators. * @@ -134,7 +134,7 @@ public class CollatingIterator implements Iterator { } /** - * Constructs a new CollatingIterator that will use the + * Constructs a new {@code CollatingIterator} that will use the * specified comparator to provide ordered iteration over the collection of * iterators. * @@ -222,7 +222,7 @@ public class CollatingIterator implements Iterator { // Iterator Methods // ------------------------------------------------------------------- /** - * Returns true if any child iterator has remaining elements. + * Returns {@code true} if any child iterator has remaining elements. * * @return true if this iterator has remaining elements */ @@ -371,8 +371,8 @@ public class CollatingIterator implements Iterator { } /** - * Returns true iff any bit in the given set is - * true. + * Returns {@code true} iff any bit in the given set is + * {@code true}. */ private boolean anyValueSet(final BitSet set) { for (int i = 0; i < set.size(); i++) { @@ -384,7 +384,7 @@ public class CollatingIterator implements Iterator { } /** - * Returns true iff any {@link Iterator} in the given list has + * Returns {@code true} iff any {@link Iterator} in the given list has * a next value. */ private boolean anyHasNext(final List> iters) { diff --git a/src/main/java/org/apache/commons/collections4/iterators/EmptyIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EmptyIterator.java index 7ab8bb1bc..2bcf193d8 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/EmptyIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/EmptyIterator.java @@ -25,7 +25,7 @@ import org.apache.commons.collections4.ResettableIterator; *

        * This class provides an implementation of an empty iterator. * This class provides for binary compatibility between Commons Collections - * 2.1.1 and 3.1 due to issues with IteratorUtils. + * 2.1.1 and 3.1 due to issues with {@code IteratorUtils}. * * @since 2.1.1 and 3.1 */ diff --git a/src/main/java/org/apache/commons/collections4/iterators/EmptyListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EmptyListIterator.java index b178579f4..0b9f6724e 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/EmptyListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/EmptyListIterator.java @@ -25,7 +25,7 @@ import org.apache.commons.collections4.ResettableListIterator; *

        * This class provides an implementation of an empty list iterator. This class * provides for binary compatibility between Commons Collections 2.1.1 and 3.1 - * due to issues with IteratorUtils. + * due to issues with {@code IteratorUtils}. * * @since 2.1.1 and 3.1 */ diff --git a/src/main/java/org/apache/commons/collections4/iterators/EntrySetMapIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EntrySetMapIterator.java index 7cae5d68d..49926a30a 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/EntrySetMapIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/EntrySetMapIterator.java @@ -23,7 +23,7 @@ import org.apache.commons.collections4.MapIterator; import org.apache.commons.collections4.ResettableIterator; /** - * Implements a MapIterator using a Map entrySet. + * Implements a {@code MapIterator} using a Map entrySet. * Reverse iteration is not supported. *

          * MapIterator it = map.mapIterator();
        @@ -60,7 +60,7 @@ public class EntrySetMapIterator implements MapIterator, ResettableI
             /**
              * Checks to see if there are more entries still to be iterated.
              *
        -     * @return true if the iterator has more elements
        +     * @return {@code true} if the iterator has more elements
              */
             @Override
             public boolean hasNext() {
        @@ -68,7 +68,7 @@ public class EntrySetMapIterator implements MapIterator, ResettableI
             }
         
             /**
        -     * Gets the next key from the Map.
        +     * Gets the next key from the {@code Map}.
              *
              * @return the next key in the iteration
              * @throws java.util.NoSuchElementException if the iteration is finished
        @@ -82,14 +82,14 @@ public class EntrySetMapIterator implements MapIterator, ResettableI
         
             //-----------------------------------------------------------------------
             /**
        -     * Removes the last returned key from the underlying Map.
        +     * Removes the last returned key from the underlying {@code Map}.
              * 

        - * This method can be called once per call to next(). + * This method can be called once per call to {@code next()}. * * @throws UnsupportedOperationException if remove is not supported by the map - * @throws IllegalStateException if next() has not yet been called - * @throws IllegalStateException if remove() has already been called - * since the last call to next() + * @throws IllegalStateException if {@code next()} has not yet been called + * @throws IllegalStateException if {@code remove()} has already been called + * since the last call to {@code next()} */ @Override public void remove() { @@ -104,10 +104,10 @@ public class EntrySetMapIterator implements MapIterator, ResettableI //----------------------------------------------------------------------- /** * Gets the current key, which is the key returned by the last call - * to next(). + * to {@code next()}. * * @return the current key - * @throws IllegalStateException if next() has not yet been called + * @throws IllegalStateException if {@code next()} has not yet been called */ @Override public K getKey() { @@ -119,10 +119,10 @@ public class EntrySetMapIterator implements MapIterator, ResettableI /** * Gets the current value, which is the value associated with the last key - * returned by next(). + * returned by {@code next()}. * * @return the current value - * @throws IllegalStateException if next() has not yet been called + * @throws IllegalStateException if {@code next()} has not yet been called */ @Override public V getValue() { @@ -138,9 +138,9 @@ public class EntrySetMapIterator implements MapIterator, ResettableI * @param value the new value * @return the previous value * @throws UnsupportedOperationException if setValue is not supported by the map - * @throws IllegalStateException if next() has not yet been called - * @throws IllegalStateException if remove() has been called since the - * last call to next() + * @throws IllegalStateException if {@code next()} has not yet been called + * @throws IllegalStateException if {@code remove()} has been called since the + * last call to {@code next()} */ @Override public V setValue(final V value) { diff --git a/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java b/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java index fa0449e0e..518ffdda6 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/EnumerationIterator.java @@ -38,7 +38,7 @@ public class EnumerationIterator implements Iterator { // Constructors //----------------------------------------------------------------------- /** - * Constructs a new EnumerationIterator that will not + * Constructs a new {@code EnumerationIterator} that will not * function until {@link #setEnumeration(Enumeration)} is called. */ public EnumerationIterator() { @@ -46,7 +46,7 @@ public class EnumerationIterator implements Iterator { } /** - * Constructs a new EnumerationIterator that provides + * Constructs a new {@code EnumerationIterator} that provides * an iterator view of the given enumeration. * * @param enumeration the enumeration to use @@ -56,7 +56,7 @@ public class EnumerationIterator implements Iterator { } /** - * Constructs a new EnumerationIterator that will remove + * Constructs a new {@code EnumerationIterator} that will remove * elements from the specified collection. * * @param enumeration the enumeration to use @@ -97,11 +97,11 @@ public class EnumerationIterator implements Iterator { /** * Removes the last retrieved element if a collection is attached. *

        - * Functions if an associated Collection is known. + * Functions if an associated {@code Collection} is known. * If so, the first occurrence of the last returned object from this * iterator will be removed from the collection. * - * @throws IllegalStateException next() not called. + * @throws IllegalStateException {@code next()} not called. * @throws UnsupportedOperationException if no associated collection */ @Override diff --git a/src/main/java/org/apache/commons/collections4/iterators/FilterIterator.java b/src/main/java/org/apache/commons/collections4/iterators/FilterIterator.java index 7789578f5..3da4b71f5 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/FilterIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/FilterIterator.java @@ -42,7 +42,7 @@ public class FilterIterator implements Iterator { //----------------------------------------------------------------------- /** - * Constructs a new FilterIterator that will not function + * Constructs a new {@code FilterIterator} that will not function * until {@link #setIterator(Iterator) setIterator} is invoked. */ public FilterIterator() { @@ -50,7 +50,7 @@ public class FilterIterator implements Iterator { } /** - * Constructs a new FilterIterator that will not function + * Constructs a new {@code FilterIterator} that will not function * until {@link #setPredicate(Predicate) setPredicate} is invoked. * * @param iterator the iterator to use @@ -61,7 +61,7 @@ public class FilterIterator implements Iterator { } /** - * Constructs a new FilterIterator that will use the + * Constructs a new {@code FilterIterator} that will use the * given iterator and predicate. * * @param iterator the iterator to use @@ -107,11 +107,11 @@ public class FilterIterator implements Iterator { * Removes from the underlying collection of the base iterator the last * element returned by this iterator. * This method can only be called - * if next() was called, but not after - * hasNext(), because the hasNext() call + * if {@code next()} was called, but not after + * {@code hasNext()}, because the {@code hasNext()} call * changes the base iterator. * - * @throws IllegalStateException if hasNext() has already + * @throws IllegalStateException if {@code hasNext()} has already * been called. */ @Override diff --git a/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java index 1f2bef298..8e4f83b24 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/FilterListIterator.java @@ -45,7 +45,7 @@ public class FilterListIterator implements ListIterator { /** * Whether or not the {@link #nextObject} has been set - * (possibly to null). + * (possibly to {@code null}). */ private boolean nextObjectSet = false; @@ -57,7 +57,7 @@ public class FilterListIterator implements ListIterator { /** * Whether or not the {@link #previousObject} has been set - * (possibly to null). + * (possibly to {@code null}). */ private boolean previousObjectSet = false; @@ -68,7 +68,7 @@ public class FilterListIterator implements ListIterator { //----------------------------------------------------------------------- /** - * Constructs a new FilterListIterator that will not function + * Constructs a new {@code FilterListIterator} that will not function * until {@link #setListIterator(ListIterator) setListIterator} * and {@link #setPredicate(Predicate) setPredicate} are invoked. */ @@ -77,7 +77,7 @@ public class FilterListIterator implements ListIterator { } /** - * Constructs a new FilterListIterator that will not + * Constructs a new {@code FilterListIterator} that will not * function until {@link #setPredicate(Predicate) setPredicate} is invoked. * * @param iterator the iterator to use @@ -88,7 +88,7 @@ public class FilterListIterator implements ListIterator { } /** - * Constructs a new FilterListIterator. + * Constructs a new {@code FilterListIterator}. * * @param iterator the iterator to use * @param predicate the predicate to use @@ -100,7 +100,7 @@ public class FilterListIterator implements ListIterator { } /** - * Constructs a new FilterListIterator that will not function + * Constructs a new {@code FilterListIterator} that will not function * until {@link #setListIterator(ListIterator) setListIterator} is invoked. * * @param predicate the predicate to use. diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java index 1cf120a2d..cda26ef5d 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java +++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorChain.java @@ -98,7 +98,7 @@ public class IteratorChain implements Iterator { } /** - * Constructs a new IteratorChain over the two given iterators. + * Constructs a new {@code IteratorChain} over the two given iterators. *

        * This method takes two iterators. The newly constructed iterator will * iterate through each one of the input iterators in turn. @@ -114,7 +114,7 @@ public class IteratorChain implements Iterator { } /** - * Constructs a new IteratorChain over the array of iterators. + * Constructs a new {@code IteratorChain} over the array of iterators. *

        * This method takes an array of iterators. The newly constructed iterator * will iterate through each one of the input iterators in turn. @@ -130,7 +130,7 @@ public class IteratorChain implements Iterator { } /** - * Constructs a new IteratorChain over the collection of + * Constructs a new {@code IteratorChain} over the collection of * iterators. *

        * This method takes a collection of iterators. The newly constructed diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java index 0b35289f2..289ebf55b 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java +++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorEnumeration.java @@ -31,14 +31,14 @@ public class IteratorEnumeration implements Enumeration { private Iterator iterator; /** - * Constructs a new IteratorEnumeration that will not function + * Constructs a new {@code IteratorEnumeration} that will not function * until {@link #setIterator(Iterator) setIterator} is invoked. */ public IteratorEnumeration() { } /** - * Constructs a new IteratorEnumeration that will use the given + * Constructs a new {@code IteratorEnumeration} that will use the given * iterator. * * @param iterator the iterator to use diff --git a/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java b/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java index 364bef301..86b7bd187 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java +++ b/src/main/java/org/apache/commons/collections4/iterators/IteratorIterable.java @@ -51,8 +51,8 @@ import org.apache.commons.collections4.ResettableIterator; * *

        * A multiple use iterable can also be explicitly constructed using any - * {@link Iterator} and specifying true for the - * multipleUse flag: + * {@link Iterator} and specifying {@code true} for the + * {@code multipleUse} flag: *

        * *
        @@ -94,7 +94,7 @@ public class IteratorIterable implements Iterable {
             private final Iterator typeSafeIterator;
         
             /**
        -     * Constructs a new IteratorIterable that will use the given
        +     * Constructs a new {@code IteratorIterable} that will use the given
              * iterator.
              *
              * @param iterator the iterator to use.
        @@ -104,11 +104,11 @@ public class IteratorIterable implements Iterable {
             }
         
             /**
        -     * Constructs a new IteratorIterable that will use the given
        +     * Constructs a new {@code IteratorIterable} that will use the given
              * iterator.
              *
              * @param iterator the iterator to use.
        -     * @param multipleUse true if the new iterable can be used in multiple iterations
        +     * @param multipleUse {@code true} if the new iterable can be used in multiple iterations
              */
             public IteratorIterable(final Iterator iterator, final boolean multipleUse) {
                 super();
        diff --git a/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java b/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java
        index 0ade28801..52a89d274 100644
        --- a/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java
        +++ b/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java
        @@ -28,18 +28,18 @@ import org.apache.commons.collections4.ResettableListIterator;
         
         /**
          * Converts an {@link Iterator} into a {@link ResettableListIterator}.
        - * For plain Iterators this is accomplished by caching the returned
        + * For plain {@code Iterator}s this is accomplished by caching the returned
          * elements.  This class can also be used to simply add
          * {@link org.apache.commons.collections4.ResettableIterator ResettableIterator}
          * functionality to a given {@link ListIterator}.
          * 

        - * The ListIterator interface has additional useful methods - * for navigation - previous() and the index methods. - * This class allows a regular Iterator to behave as a - * ListIterator. It achieves this by building a list internally + * The {@code ListIterator} interface has additional useful methods + * for navigation - {@code previous()} and the index methods. + * This class allows a regular {@code Iterator} to behave as a + * {@code ListIterator}. It achieves this by building a list internally * of as the underlying iterator is traversed. *

        - * The optional operations of ListIterator are not supported for plain Iterators. + * The optional operations of {@code ListIterator} are not supported for plain {@code Iterator}s. *

        * This class implements ResettableListIterator from Commons Collections 3.2. * @@ -69,7 +69,7 @@ public class ListIteratorWrapper implements ResettableListIterator { // Constructor //------------------------------------------------------------------------- /** - * Constructs a new ListIteratorWrapper that will wrap + * Constructs a new {@code ListIteratorWrapper} that will wrap * the given iterator. * * @param iterator the iterator to wrap @@ -84,7 +84,7 @@ public class ListIteratorWrapper implements ResettableListIterator { //------------------------------------------------------------------------- /** * Throws {@link UnsupportedOperationException} - * unless the underlying Iterator is a ListIterator. + * unless the underlying {@code Iterator} is a {@code ListIterator}. * * @param obj the object to add * @throws UnsupportedOperationException if the underlying iterator is not of @@ -229,7 +229,7 @@ public class ListIteratorWrapper implements ResettableListIterator { /** * Throws {@link UnsupportedOperationException} - * unless the underlying Iterator is a ListIterator. + * unless the underlying {@code Iterator} is a {@code ListIterator}. * * @param obj the object to set * @throws UnsupportedOperationException if the underlying iterator is not of diff --git a/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java index 5de239792..a3cbb4f88 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java @@ -62,7 +62,7 @@ public class LoopingIterator implements ResettableIterator { * Returns false only if the collection originally had zero elements, or * all the elements have been {@link #remove removed}. * - * @return true if there are more elements + * @return {@code true} if there are more elements */ @Override public boolean hasNext() { diff --git a/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java index cd3bc76a9..50b5c6a97 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java @@ -65,7 +65,7 @@ public class LoopingListIterator implements ResettableListIterator { * Returns false only if the list originally had zero elements, or * all elements have been {@link #remove removed}. * - * @return true if there are more elements + * @return {@code true} if there are more elements */ @Override public boolean hasNext() { @@ -121,7 +121,7 @@ public class LoopingListIterator implements ResettableListIterator { * Returns false only if the list originally had zero elements, or * all elements have been {@link #remove removed}. * - * @return true if there are more elements + * @return {@code true} if there are more elements */ @Override public boolean hasPrevious() { diff --git a/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java index 66c172126..955483e71 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/NodeListIterator.java @@ -52,7 +52,7 @@ public class NodeListIterator implements Iterator { /** * Constructor, that creates a new NodeListIterator from the specified - * org.w3c.NodeList + * {@code org.w3c.NodeList} * * @param nodeList node list, which is wrapped by this class. Must not be null * @throws NullPointerException if nodeList is null diff --git a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java index ca3d664e4..7d6883e9a 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayIterator.java @@ -49,7 +49,7 @@ public class ObjectArrayIterator implements ResettableIterator { * specified array. * * @param array the array to iterate over - * @throws NullPointerException if array is null + * @throws NullPointerException if {@code array} is {@code null} */ public ObjectArrayIterator(final E... array) { this(array, 0, array.length); @@ -61,7 +61,7 @@ public class ObjectArrayIterator implements ResettableIterator { * * @param array the array to iterate over * @param start the index to start iterating at - * @throws NullPointerException if array is null + * @throws NullPointerException if {@code array} is {@code null} * @throws IndexOutOfBoundsException if the start index is out of bounds */ public ObjectArrayIterator(final E array[], final int start) { @@ -77,7 +77,7 @@ public class ObjectArrayIterator implements ResettableIterator { * @param end the index (exclusive) to finish iterating at * @throws IndexOutOfBoundsException if the start or end index is out of bounds * @throws IllegalArgumentException if end index is before the start - * @throws NullPointerException if array is null + * @throws NullPointerException if {@code array} is {@code null} */ public ObjectArrayIterator(final E array[], final int start, final int end) { super(); diff --git a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java index db4604553..758f1e222 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ObjectArrayListIterator.java @@ -39,9 +39,9 @@ public class ObjectArrayListIterator extends ObjectArrayIterator implements ResettableListIterator { /** - * Holds the index of the last item returned by a call to next() - * or previous(). This is set to -1 if neither method - * has yet been invoked. lastItemIndex is used to to implement the + * Holds the index of the last item returned by a call to {@code next()} + * or {@code previous()}. This is set to {@code -1} if neither method + * has yet been invoked. {@code lastItemIndex} is used to to implement the * {@link #set} method. */ private int lastItemIndex = -1; @@ -52,7 +52,7 @@ public class ObjectArrayListIterator extends ObjectArrayIterator * specified array. * * @param array the array to iterate over - * @throws NullPointerException if array is null + * @throws NullPointerException if {@code array} is {@code null} */ public ObjectArrayListIterator(final E... array) { super(array); @@ -64,7 +64,7 @@ public class ObjectArrayListIterator extends ObjectArrayIterator * * @param array the array to iterate over * @param start the index to start iterating at - * @throws NullPointerException if array is null + * @throws NullPointerException if {@code array} is {@code null} * @throws IndexOutOfBoundsException if the start index is out of bounds */ public ObjectArrayListIterator(final E[] array, final int start) { @@ -80,7 +80,7 @@ public class ObjectArrayListIterator extends ObjectArrayIterator * @param end the index (exclusive) to finish iterating at * @throws IndexOutOfBoundsException if the start or end index is out of bounds * @throws IllegalArgumentException if end index is before the start - * @throws NullPointerException if array is null + * @throws NullPointerException if {@code array} is {@code null} */ public ObjectArrayListIterator(final E[] array, final int start, final int end) { super(array, start, end); @@ -167,11 +167,11 @@ public class ObjectArrayListIterator extends ObjectArrayIterator * This method sets the element that was returned by the last call * to {@link #next()} of {@link #previous()}. * - * Note: {@link java.util.ListIterator} implementations that support add() - * and remove() only allow set() to be called once per call - * to next() or previous (see the {@link java.util.ListIterator} + * Note: {@link java.util.ListIterator} implementations that support {@code add()} + * and {@code remove()} only allow {@code set()} to be called once per call + * to {@code next()} or {@code previous} (see the {@link java.util.ListIterator} * javadoc for more details). Since this implementation does not support - * add() or remove(), set() may be + * {@code add()} or {@code remove()}, {@code set()} may be * called as often as desired. * * @param obj the object to set into the array diff --git a/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java index 162f170e0..0eb97a095 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java @@ -28,8 +28,8 @@ import org.apache.commons.collections4.Transformer; *

        * This iterator can extract multiple objects from a complex tree-like object graph. * The iteration starts from a single root object. - * It uses a Transformer to extract the iterators and elements. - * Its main benefit is that no intermediate List is created. + * It uses a {@code Transformer} to extract the iterators and elements. + * Its main benefit is that no intermediate {@code List} is created. *

        * For example, consider an object graph: *

        @@ -43,7 +43,7 @@ import org.apache.commons.collections4.Transformer;
          *         |- Tree |         /- Leaf
          *                 |- Branch -- Leaf
          *                 |- Branch -- Leaf
        - * The following Transformer, used in this class, will extract all + * The following {@code Transformer}, used in this class, will extract all * the Leaf objects without creating a combined intermediate list: *
          * public Object transform(Object input) {
        diff --git a/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java
        index e38b9606c..ff4c2d873 100644
        --- a/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java
        +++ b/src/main/java/org/apache/commons/collections4/iterators/ReverseListIterator.java
        @@ -27,10 +27,10 @@ import org.apache.commons.collections4.ResettableListIterator;
          * and continuing to the first. This is useful for looping around
          * a list in reverse order without needing to actually reverse the list.
          * 

        - * The first call to next() will return the last element - * from the list, and so on. The hasNext() method works - * in concert with the next() method as expected. - * However, the nextIndex() method returns the correct + * The first call to {@code next()} will return the last element + * from the list, and so on. The {@code hasNext()} method works + * in concert with the {@code next()} method as expected. + * However, the {@code nextIndex()} method returns the correct * index in the list, thus it starts high and reduces as the iteration * continues. The previous methods work similarly. * diff --git a/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java b/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java index 451d49066..6ccec888f 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java @@ -21,7 +21,7 @@ import java.util.NoSuchElementException; import org.apache.commons.collections4.ResettableIterator; /** - * SingletonIterator is an {@link java.util.Iterator} over a single + * {@code SingletonIterator} is an {@link java.util.Iterator} over a single * object instance. * * @since 2.0 @@ -39,7 +39,7 @@ public class SingletonIterator private E object; /** - * Constructs a new SingletonIterator where remove + * Constructs a new {@code SingletonIterator} where {@code remove} * is a permitted operation. * * @param object the single object to return from the iterator @@ -49,8 +49,8 @@ public class SingletonIterator } /** - * Constructs a new SingletonIterator optionally choosing if - * remove is a permitted operation. + * Constructs a new {@code SingletonIterator} optionally choosing if + * {@code remove} is a permitted operation. * * @param object the single object to return from the iterator * @param removeAllowed true if remove is allowed diff --git a/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java index c554bf490..312f393f8 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/SingletonListIterator.java @@ -21,7 +21,7 @@ import java.util.NoSuchElementException; import org.apache.commons.collections4.ResettableListIterator; /** - * SingletonIterator is an {@link java.util.ListIterator} over a single + * {@code SingletonIterator} is an {@link java.util.ListIterator} over a single * object instance. * * @since 2.1 @@ -34,7 +34,7 @@ public class SingletonListIterator implements ResettableListIterator { private E object; /** - * Constructs a new SingletonListIterator. + * Constructs a new {@code SingletonListIterator}. * * @param object the single object to return from the iterator */ diff --git a/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java b/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java index e930c050b..61709badc 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/TransformIterator.java @@ -34,7 +34,7 @@ public class TransformIterator implements Iterator { //----------------------------------------------------------------------- /** - * Constructs a new TransformIterator that will not function + * Constructs a new {@code TransformIterator} that will not function * until the {@link #setIterator(Iterator) setIterator} and * {@link #setTransformer(Transformer)} methods are invoked. */ @@ -43,7 +43,7 @@ public class TransformIterator implements Iterator { } /** - * Constructs a new TransformIterator that won't transform + * Constructs a new {@code TransformIterator} that won't transform * elements from the given iterator. * * @param iterator the iterator to use @@ -54,7 +54,7 @@ public class TransformIterator implements Iterator { } /** - * Constructs a new TransformIterator that will use the + * Constructs a new {@code TransformIterator} that will use the * given iterator and transformer. If the given transformer is null, * then objects will not be transformed. * diff --git a/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java b/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java index f95c31ca2..80b01de72 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/UniqueFilterIterator.java @@ -32,7 +32,7 @@ public class UniqueFilterIterator extends FilterIterator { //------------------------------------------------------------------------- /** - * Constructs a new UniqueFilterIterator. + * Constructs a new {@code UniqueFilterIterator}. * * @param iterator the iterator to use */ diff --git a/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java index b12a35e69..5e6ba8de6 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/ZippingIterator.java @@ -50,7 +50,7 @@ public class ZippingIterator implements Iterator { // ---------------------------------------------------------------------- /** - * Constructs a new ZippingIterator that will provide + * Constructs a new {@code ZippingIterator} that will provide * interleaved iteration over the two given iterators. * * @param a the first child iterator @@ -63,7 +63,7 @@ public class ZippingIterator implements Iterator { } /** - * Constructs a new ZippingIterator that will provide + * Constructs a new {@code ZippingIterator} that will provide * interleaved iteration over the three given iterators. * * @param a the first child iterator @@ -79,7 +79,7 @@ public class ZippingIterator implements Iterator { } /** - * Constructs a new ZippingIterator that will provide + * Constructs a new {@code ZippingIterator} that will provide * interleaved iteration of the specified iterators. * * @param iterators the array of iterators diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java index 3cc008c62..c6d7c28f1 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java @@ -19,7 +19,7 @@ package org.apache.commons.collections4.keyvalue; import org.apache.commons.collections4.KeyValue; /** - * Abstract pair class to assist with creating KeyValue + * Abstract pair class to assist with creating {@code KeyValue} * and {@link java.util.Map.Entry Map.Entry} implementations. * * @param the type of keys diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java index b27d4d50f..f5f87171e 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java @@ -41,9 +41,9 @@ public abstract class AbstractMapEntry extends AbstractKeyValue impl // Map.Entry interface //------------------------------------------------------------------------- /** - * Sets the value stored in this Map.Entry. + * Sets the value stored in this {@code Map.Entry}. *

        - * This Map.Entry is not connected to a Map, so only the + * This {@code Map.Entry} is not connected to a Map, so only the * local data is changed. * * @param value the new value @@ -55,7 +55,7 @@ public abstract class AbstractMapEntry extends AbstractKeyValue impl } /** - * Compares this Map.Entry with another Map.Entry. + * Compares this {@code Map.Entry} with another {@code Map.Entry}. *

        * Implemented per API documentation of {@link java.util.Map.Entry#equals(Object)} * diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java index 5ceea1afd..2cd45429c 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java @@ -31,13 +31,13 @@ import org.apache.commons.collections4.KeyValue; */ public abstract class AbstractMapEntryDecorator implements Map.Entry, KeyValue { - /** The Map.Entry to decorate */ + /** The {@code Map.Entry} to decorate */ private final Map.Entry entry; /** * Constructor that wraps (not copies). * - * @param entry the Map.Entry to decorate, must not be null + * @param entry the {@code Map.Entry} to decorate, must not be null * @throws NullPointerException if the collection is null */ public AbstractMapEntryDecorator(final Map.Entry entry) { diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java b/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java index 05b5cea6d..17950761d 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java @@ -21,10 +21,10 @@ import java.util.Map; import org.apache.commons.collections4.KeyValue; /** - * A mutable KeyValue pair that does not implement + * A mutable {@code KeyValue} pair that does not implement * {@link java.util.Map.Entry Map.Entry}. *

        - * Note that a DefaultKeyValue instance may not contain + * Note that a {@code DefaultKeyValue} instance may not contain * itself as a key or value. *

        * @@ -52,7 +52,7 @@ public class DefaultKeyValue extends AbstractKeyValue { } /** - * Constructs a new pair from the specified KeyValue. + * Constructs a new pair from the specified {@code KeyValue}. * * @param pair the pair to copy, must not be null * @throws NullPointerException if the entry is null @@ -62,7 +62,7 @@ public class DefaultKeyValue extends AbstractKeyValue { } /** - * Constructs a new pair from the specified Map.Entry. + * Constructs a new pair from the specified {@code Map.Entry}. * * @param entry the entry to copy, must not be null * @throws NullPointerException if the entry is null @@ -106,7 +106,7 @@ public class DefaultKeyValue extends AbstractKeyValue { //----------------------------------------------------------------------- /** - * Returns a new Map.Entry object with key and value from this pair. + * Returns a new {@code Map.Entry} object with key and value from this pair. * * @return a MapEntry instance */ @@ -116,9 +116,9 @@ public class DefaultKeyValue extends AbstractKeyValue { //----------------------------------------------------------------------- /** - * Compares this Map.Entry with another Map.Entry. + * Compares this {@code Map.Entry} with another {@code Map.Entry}. *

        - * Returns true if the compared object is also a DefaultKeyValue, + * Returns true if the compared object is also a {@code DefaultKeyValue}, * and its key and value are equal to this object's key and value. * * @param obj the object to compare to diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java index 29c2d7d2c..19b99ea17 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java @@ -41,7 +41,7 @@ public final class DefaultMapEntry extends AbstractMapEntry { } /** - * Constructs a new entry from the specified KeyValue. + * Constructs a new entry from the specified {@code KeyValue}. * * @param pair the pair to copy, must not be null * @throws NullPointerException if the entry is null @@ -51,7 +51,7 @@ public final class DefaultMapEntry extends AbstractMapEntry { } /** - * Constructs a new entry from the specified Map.Entry. + * Constructs a new entry from the specified {@code Map.Entry}. * * @param entry the entry to copy, must not be null * @throws NullPointerException if the entry is null diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java b/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java index 1897c20e0..1261a06a3 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java @@ -21,7 +21,7 @@ import java.util.Arrays; import java.util.Objects; /** - * A MultiKey allows multiple map keys to be merged together. + * A {@code MultiKey} allows multiple map keys to be merged together. *

        * The purpose of this class is to avoid the need to write code to handle * maps of maps. An example might be the need to look up a file name by @@ -124,7 +124,7 @@ public class MultiKey implements Serializable { * The keys should be immutable * If they are not then they must not be changed after adding to the MultiKey. *

        - * This is equivalent to new MultiKey(keys, true). + * This is equivalent to {@code new MultiKey(keys, true)}. * * @param keys the array of keys, not null * @throws NullPointerException if the key array is null @@ -211,7 +211,7 @@ public class MultiKey implements Serializable { /** * Compares this object to another. *

        - * To be equal, the other object must be a MultiKey with the + * To be equal, the other object must be a {@code MultiKey} with the * same number of keys which are also equal. * * @param other the other object to compare to diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java index 5748778ab..0400f45b9 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/TiedMapEntry.java @@ -93,7 +93,7 @@ public class TiedMapEntry implements Map.Entry, KeyValue, Seri } /** - * Compares this Map.Entry with another Map.Entry. + * Compares this {@code Map.Entry} with another {@code Map.Entry}. *

        * Implemented per API documentation of {@link java.util.Map.Entry#equals(Object)} * diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java b/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java index 83c681748..a96642022 100644 --- a/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java +++ b/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java @@ -23,7 +23,7 @@ import org.apache.commons.collections4.Unmodifiable; /** * A {@link java.util.Map.Entry Map.Entry} that throws - * UnsupportedOperationException when setValue is called. + * UnsupportedOperationException when {@code setValue} is called. * * @param the type of keys * @param the type of mapped values @@ -42,7 +42,7 @@ public final class UnmodifiableMapEntry extends AbstractMapEntry imp } /** - * Constructs a new entry from the specified KeyValue. + * Constructs a new entry from the specified {@code KeyValue}. * * @param pair the pair to copy, must not be null * @throws NullPointerException if the entry is null @@ -52,7 +52,7 @@ public final class UnmodifiableMapEntry extends AbstractMapEntry imp } /** - * Constructs a new entry from the specified Map.Entry. + * Constructs a new entry from the specified {@code Map.Entry}. * * @param entry the entry to copy, must not be null * @throws NullPointerException if the entry is null diff --git a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java index 3dfdf7192..6eebc376c 100644 --- a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java +++ b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java @@ -56,8 +56,8 @@ public abstract class AbstractLinkedList implements List { /** * A {@link Node} which indicates the start and end of the list and does not - * hold a value. The value of next is the first item in the - * list. The value of of previous is the last item in the list. + * hold a value. The value of {@code next} is the first item in the + * list. The value of of {@code previous} is the last item in the list. */ transient Node header; @@ -90,7 +90,7 @@ public abstract class AbstractLinkedList implements List { /** * The equivalent of a default constructor, broken out so it can be called - * by any constructor and by readObject. + * by any constructor and by {@code readObject}. * Subclasses which override this method should make sure they call super, * so the list is initialised properly. */ @@ -266,9 +266,9 @@ public abstract class AbstractLinkedList implements List { * {@inheritDoc} *

        * This implementation iterates over the elements of this list, checking each element in - * turn to see if it's contained in coll. If it's contained, it's removed + * turn to see if it's contained in {@code coll}. If it's contained, it's removed * from this list. As a consequence, it is advised to use a collection type for - * coll that provides a fast (e.g. O(1)) implementation of + * {@code coll} that provides a fast (e.g. O(1)) implementation of * {@link Collection#contains(Object)}. */ @Override @@ -290,9 +290,9 @@ public abstract class AbstractLinkedList implements List { * {@inheritDoc} *

        * This implementation iterates over the elements of this list, checking each element in - * turn to see if it's contained in coll. If it's not contained, it's removed + * turn to see if it's contained in {@code coll}. If it's not contained, it's removed * from this list. As a consequence, it is advised to use a collection type for - * coll that provides a fast (e.g. O(1)) implementation of + * {@code coll} that provides a fast (e.g. O(1)) implementation of * {@link Collection#contains(Object)}. */ @Override @@ -476,14 +476,14 @@ public abstract class AbstractLinkedList implements List { /** * Creates a new node with the specified object as its - * value and inserts it before node. + * {@code value} and inserts it before {@code node}. *

        * This implementation uses {@link #createNode(Object)} and * {@link #addNode(AbstractLinkedList.Node,AbstractLinkedList.Node)}. * * @param node node to insert before * @param value value of the newly added node - * @throws NullPointerException if node is null + * @throws NullPointerException if {@code node} is null */ protected void addNodeBefore(final Node node, final E value) { final Node newNode = createNode(value); @@ -492,14 +492,14 @@ public abstract class AbstractLinkedList implements List { /** * Creates a new node with the specified object as its - * value and inserts it after node. + * {@code value} and inserts it after {@code node}. *

        * This implementation uses {@link #createNode(Object)} and * {@link #addNode(AbstractLinkedList.Node,AbstractLinkedList.Node)}. * * @param node node to insert after * @param value value of the newly added node - * @throws NullPointerException if node is null + * @throws NullPointerException if {@code node} is null */ protected void addNodeAfter(final Node node, final E value) { final Node newNode = createNode(value); @@ -526,7 +526,7 @@ public abstract class AbstractLinkedList implements List { * Removes the specified node from the list. * * @param node the node to remove - * @throws NullPointerException if node is null + * @throws NullPointerException if {@code node} is null */ protected void removeNode(final Node node) { node.previous.next = node.next; @@ -616,7 +616,7 @@ public abstract class AbstractLinkedList implements List { * Serializes the data held in this object to the stream specified. *

        * The first serializable subclass must call this method from - * writeObject. + * {@code writeObject}. * * @param outputStream the stream to write the object to * @throws IOException if anything goes wrong @@ -633,7 +633,7 @@ public abstract class AbstractLinkedList implements List { * Deserializes the data held in this object to the stream specified. *

        * The first serializable subclass must call this method from - * readObject. + * {@code readObject}. * * @param inputStream the stream to read the object from * @throws IOException if any error occurs while reading from the stream @@ -652,7 +652,7 @@ public abstract class AbstractLinkedList implements List { /** * A node within the linked list. *

        - * From Commons Collections 3.1, all access to the value property + * From Commons Collections 3.1, all access to the {@code value} property * is via the methods on this class. */ protected static class Node { @@ -780,7 +780,7 @@ public abstract class AbstractLinkedList implements List { /** * The last node that was returned by {@link #next()} or {@link - * #previous()}. Set to null if {@link #next()} or {@link + * #previous()}. Set to {@code null} if {@link #next()} or {@link * #previous()} haven't been called, or if the node has been removed * with {@link #remove()} or a new node added with {@link #add(Object)}. * Should be accessed through {@link #getLastNodeReturned()} to enforce diff --git a/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java b/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java index ea02b2192..e2d8cc0eb 100644 --- a/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java +++ b/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java @@ -29,25 +29,25 @@ import java.util.List; import java.util.ListIterator; /** - * A List implementation with a ListIterator that + * A {@code List} implementation with a {@code ListIterator} that * allows concurrent modifications to the underlying list. *

        * This implementation supports all of the optional {@link List} operations. - * It extends AbstractLinkedList and thus provides the + * It extends {@code AbstractLinkedList} and thus provides the * stack/queue/dequeue operations available in {@link java.util.LinkedList}. *

        *

        * 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()} - * methods provides access to a Cursor instance which extends - * ListIterator. The cursor allows changes to the list concurrent + * methods provides access to a {@code Cursor} instance which extends + * {@code ListIterator}. The cursor allows changes to the list concurrent * with changes to the iterator. Note that the {@link #iterator()} method and * sublists do not provide this cursor behaviour. *

        *

        - * The Cursor class is provided partly for backwards compatibility + * The {@code Cursor} 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 WeakReference. + * cursor is optional because references are held via a {@code WeakReference}. * For most purposes, simply modify the iterator and list at will, and then let * the garbage collector to the rest. *

        @@ -86,7 +86,7 @@ public class CursorableLinkedList extends AbstractLinkedList implements Se /** * The equivalent of a default constructor called - * by any constructor and by readObject. + * by any constructor and by {@code readObject}. */ @Override protected void init() { @@ -153,10 +153,10 @@ public class CursorableLinkedList extends AbstractLinkedList implements Se /** * Returns a {@link Cursor} for iterating through the elements of this list. *

        - * A Cursor is a ListIterator with an additional - * close() method. Calling this method immediately discards the + * A {@code Cursor} is a {@code ListIterator} with an additional + * {@code close()} method. Calling this method immediately discards the * references to the cursor. If it is not called, then the garbage collector - * will still remove the reference as it is held via a WeakReference. + * will still remove the reference as it is held via a {@code WeakReference}. *

        * The cursor enables iteration and list changes to occur in any order without * invalidating the iterator (from one thread). When elements are added to the @@ -169,7 +169,7 @@ public class CursorableLinkedList extends AbstractLinkedList implements Se * last returned value such that it cannot be removed). *

        * The {@link #listIterator()} method returns the same as this method, and can - * be cast to a Cursor if the close method is required. + * be cast to a {@code Cursor} if the {@code close} method is required. * * @return a new cursor iterator */ @@ -181,10 +181,10 @@ public class CursorableLinkedList extends AbstractLinkedList implements Se * Returns a {@link Cursor} for iterating through the elements of this list * starting from a specified index. *

        - * A Cursor is a ListIterator with an additional - * close() method. Calling this method immediately discards the + * A {@code Cursor} is a {@code ListIterator} with an additional + * {@code close()} method. Calling this method immediately discards the * references to the cursor. If it is not called, then the garbage collector - * will still remove the reference as it is held via a WeakReference. + * will still remove the reference as it is held via a {@code WeakReference}. *

        * The cursor enables iteration and list changes to occur in any order without * invalidating the iterator (from one thread). When elements are added to the @@ -197,7 +197,7 @@ public class CursorableLinkedList extends AbstractLinkedList implements Se * last returned value such that it cannot be removed). *

        * The {@link #listIterator(int)} method returns the same as this method, and can - * be cast to a Cursor if the close method is required. + * be cast to a {@code Cursor} if the {@code close} method is required. * * @param fromIndex the index to start from * @return a new cursor iterator @@ -242,7 +242,7 @@ public class CursorableLinkedList extends AbstractLinkedList implements Se * Removes the specified node from the list. * * @param node the node to remove - * @throws NullPointerException if node is null + * @throws NullPointerException if {@code node} is null */ @Override protected void removeNode(final Node node) { @@ -399,7 +399,7 @@ public class CursorableLinkedList extends AbstractLinkedList implements Se //----------------------------------------------------------------------- /** - * An extended ListIterator that allows concurrent changes to + * An extended {@code ListIterator} that allows concurrent changes to * the underlying list. */ public static class Cursor extends AbstractLinkedList.LinkedListIterator { diff --git a/src/main/java/org/apache/commons/collections4/list/FixedSizeList.java b/src/main/java/org/apache/commons/collections4/list/FixedSizeList.java index 5bdcb6310..9a87de889 100644 --- a/src/main/java/org/apache/commons/collections4/list/FixedSizeList.java +++ b/src/main/java/org/apache/commons/collections4/list/FixedSizeList.java @@ -27,7 +27,7 @@ import org.apache.commons.collections4.iterators.AbstractListIteratorDecorator; import org.apache.commons.collections4.iterators.UnmodifiableIterator; /** - * Decorates another List to fix the size preventing add/remove. + * Decorates another {@code List} to fix the size preventing add/remove. *

        * The add, remove, clear and retain operations are unsupported. * The set method is allowed (as it doesn't change the list size). diff --git a/src/main/java/org/apache/commons/collections4/list/GrowthList.java b/src/main/java/org/apache/commons/collections4/list/GrowthList.java index 79d28d13f..4ade5d1c2 100644 --- a/src/main/java/org/apache/commons/collections4/list/GrowthList.java +++ b/src/main/java/org/apache/commons/collections4/list/GrowthList.java @@ -22,7 +22,7 @@ import java.util.Collections; import java.util.List; /** - * Decorates another List to make it seamlessly grow when + * Decorates another {@code List} to make it seamlessly grow when * indices larger than the list size are used on add and set, * avoiding most IndexOutOfBoundsExceptions. *

        @@ -32,7 +32,7 @@ import java.util.List; *

        *

        * Trying to set or add to an index larger than the size will cause the list - * to grow (using null elements). Clearly, care must be taken + * to grow (using {@code null} elements). Clearly, care must be taken * not to use excessively large indices, as the internal list will grow to * match. *

        @@ -41,8 +41,8 @@ import java.util.List; * call the underlying list and probably result in an IndexOutOfBoundsException. *

        *

        - * Take care when using this list with null values, as - * null is the value added when growing the list. + * Take care when using this list with {@code null} values, as + * {@code null} is the value added when growing the list. *

        *

        * All sub-lists will access the underlying list directly, and will throw @@ -50,7 +50,7 @@ import java.util.List; *

        *

        * This class differs from {@link LazyList} because here growth occurs on - * set and add, where LazyList grows on get. However, they + * set and add, where {@code LazyList} grows on get. However, they * can be used together by decorating twice. *

        * @@ -109,7 +109,7 @@ public class GrowthList extends AbstractSerializableListDecorator { *

        * If the requested index is greater than the current size, the list will * grow to the new size. Indices between the old size and the requested - * size will be filled with null. + * size will be filled with {@code null}. *

        * If the index is less than the current size, the value will be added to * the underlying list directly. @@ -137,7 +137,7 @@ public class GrowthList extends AbstractSerializableListDecorator { *

        * If the requested index is greater than the current size, the list will * grow to the new size. Indices between the old size and the requested - * size will be filled with null. + * size will be filled with {@code null}. *

        * If the index is less than the current size, the values will be added to * the underlying list directly. @@ -168,7 +168,7 @@ public class GrowthList extends AbstractSerializableListDecorator { *

        * If the requested index is greater than the current size, the list will * grow to the new size. Indices between the old size and the requested - * size will be filled with null. + * size will be filled with {@code null}. *

        * If the index is less than the current size, the value will be set onto * the underlying list directly. diff --git a/src/main/java/org/apache/commons/collections4/list/LazyList.java b/src/main/java/org/apache/commons/collections4/list/LazyList.java index e9e227032..d23672c87 100644 --- a/src/main/java/org/apache/commons/collections4/list/LazyList.java +++ b/src/main/java/org/apache/commons/collections4/list/LazyList.java @@ -23,7 +23,7 @@ import org.apache.commons.collections4.Factory; import org.apache.commons.collections4.Transformer; /** - * Decorates another List to create objects in the list on demand. + * Decorates another {@code List} to create objects in the list on demand. *

        * When the {@link #get(int)} method is called with an index greater than * the size of the list, the list will automatically grow in size and return @@ -47,14 +47,14 @@ import org.apache.commons.collections4.Transformer; *

        * *

        - * After the above code is executed, date will contain - * a new Date instance. Furthermore, that Date + * After the above code is executed, {@code date} will contain + * a new {@code Date} instance. Furthermore, that {@code Date} * instance is the fourth element in the list. The first, second, - * and third element are all set to null. + * and third element are all set to {@code null}. *

        *

        * This class differs from {@link GrowthList} because here growth occurs on - * get, where GrowthList grows on set and add. However, they + * get, where {@code GrowthList} grows on set and add. However, they * could easily be used together by decorating twice. *

        *

        diff --git a/src/main/java/org/apache/commons/collections4/list/NodeCachingLinkedList.java b/src/main/java/org/apache/commons/collections4/list/NodeCachingLinkedList.java index a1285572a..658f8b829 100644 --- a/src/main/java/org/apache/commons/collections4/list/NodeCachingLinkedList.java +++ b/src/main/java/org/apache/commons/collections4/list/NodeCachingLinkedList.java @@ -23,7 +23,7 @@ import java.io.Serializable; import java.util.Collection; /** - * A List implementation that stores a cache of internal Node objects + * A {@code List} implementation that stores a cache of internal Node objects * in an effort to reduce wasteful object creation. *

        * A linked list creates one Node for each item of data added. This can result in @@ -52,9 +52,9 @@ public class NodeCachingLinkedList extends AbstractLinkedList implements S private static final int DEFAULT_MAXIMUM_CACHE_SIZE = 20; /** - * The first cached node, or null if no nodes are cached. + * The first cached node, or {@code null} if no nodes are cached. * Cached nodes are stored in a singly-linked list with - * next pointing to the next element. + * {@code next} pointing to the next element. */ private transient Node firstCachedNode; @@ -130,9 +130,9 @@ public class NodeCachingLinkedList extends AbstractLinkedList implements S /** * Gets a node from the cache. If a node is returned, then the value of * {@link #cacheSize} is decreased accordingly. The node that is returned - * will have null values for next, previous and element. + * will have {@code null} values for next, previous and element. * - * @return a node, or null if there are no nodes in the cache. + * @return a node, or {@code null} if there are no nodes in the cache. */ protected Node getNodeFromCache() { if (cacheSize == 0) { diff --git a/src/main/java/org/apache/commons/collections4/list/PredicatedList.java b/src/main/java/org/apache/commons/collections4/list/PredicatedList.java index a665b49e3..3ca7557bd 100644 --- a/src/main/java/org/apache/commons/collections4/list/PredicatedList.java +++ b/src/main/java/org/apache/commons/collections4/list/PredicatedList.java @@ -25,7 +25,7 @@ import org.apache.commons.collections4.collection.PredicatedCollection; import org.apache.commons.collections4.iterators.AbstractListIteratorDecorator; /** - * Decorates another List to validate that all additions + * Decorates another {@code List} to validate that all additions * match a specified predicate. *

        * This list exists to provide validation for the decorated list. diff --git a/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java b/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java index 7a43146cf..ac5a2777f 100644 --- a/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java +++ b/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java @@ -33,10 +33,10 @@ import org.apache.commons.collections4.iterators.AbstractListIteratorDecorator; import org.apache.commons.collections4.set.UnmodifiableSet; /** - * Decorates a List to ensure that no duplicates are present much - * like a Set. + * Decorates a {@code List} to ensure that no duplicates are present much + * like a {@code Set}. *

        - * The List interface makes certain assumptions/requirements. This + * The {@code List} interface makes certain assumptions/requirements. This * implementation breaks these in certain ways, but this is merely the result of * rejecting duplicates. Each violation is explained in the method, but it * should not affect you. Bear in mind that Sets require immutable objects to @@ -65,7 +65,7 @@ public class SetUniqueList extends AbstractSerializableListDecorator { * Factory method to create a SetList using the supplied list to retain order. *

        * If the list contains duplicates, these are removed (first indexed one - * kept). A HashSet is used for the set behaviour. + * kept). A {@code HashSet} is used for the set behaviour. * * @param the element type * @param list the list to decorate, must not be null @@ -114,9 +114,9 @@ public class SetUniqueList extends AbstractSerializableListDecorator { /** * Adds an element to the list if it is not already present. *

        - * (Violation) The List interface requires that this - * method returns true always. However this class may return - * false because of the Set behaviour. + * (Violation) The {@code List} interface requires that this + * method returns {@code true} always. However this class may return + * {@code false} because of the {@code Set} behaviour. * * @param object the object to add * @return true if object was added @@ -137,7 +137,7 @@ public class SetUniqueList extends AbstractSerializableListDecorator { * Adds an element to a specific index in the list if it is not already * present. *

        - * (Violation) The List interface makes the assumption + * (Violation) The {@code List} interface makes the assumption * that the element is always inserted. This may not happen with this * implementation. * @@ -159,7 +159,7 @@ public class SetUniqueList extends AbstractSerializableListDecorator { * Only elements that are not already in this list will be added, and * duplicates from the specified collection will be ignored. *

        - * (Violation) The List interface makes the assumption + * (Violation) The {@code List} interface makes the assumption * that the elements are always inserted. This may not happen with this * implementation. * @@ -178,7 +178,7 @@ public class SetUniqueList extends AbstractSerializableListDecorator { * Only elements that are not already in this list will be added, and * duplicates from the specified collection will be ignored. *

        - * (Violation) The List interface makes the assumption + * (Violation) The {@code List} interface makes the assumption * that the elements are always inserted. This may not happen with this * implementation. * @@ -265,9 +265,9 @@ public class SetUniqueList extends AbstractSerializableListDecorator { * {@inheritDoc} *

        * This implementation iterates over the elements of this list, checking - * each element in turn to see if it's contained in coll. + * each element in turn to see if it's contained in {@code coll}. * If it's not contained, it's removed from this list. As a consequence, - * it is advised to use a collection type for coll that provides + * it is advised to use a collection type for {@code coll} that provides * a fast (e.g. O(1)) implementation of {@link Collection#contains(Object)}. */ @Override diff --git a/src/main/java/org/apache/commons/collections4/list/TransformedList.java b/src/main/java/org/apache/commons/collections4/list/TransformedList.java index 8ce2165e2..d51bd366c 100644 --- a/src/main/java/org/apache/commons/collections4/list/TransformedList.java +++ b/src/main/java/org/apache/commons/collections4/list/TransformedList.java @@ -25,7 +25,7 @@ import org.apache.commons.collections4.collection.TransformedCollection; import org.apache.commons.collections4.iterators.AbstractListIteratorDecorator; /** - * Decorates another List to transform objects that are added. + * Decorates another {@code List} to transform objects that are added. *

        * The add and set methods are affected by this class. * Thus objects must be removed or searched for using their transformed form. diff --git a/src/main/java/org/apache/commons/collections4/list/TreeList.java b/src/main/java/org/apache/commons/collections4/list/TreeList.java index fc2421557..90d3be508 100644 --- a/src/main/java/org/apache/commons/collections4/list/TreeList.java +++ b/src/main/java/org/apache/commons/collections4/list/TreeList.java @@ -29,12 +29,12 @@ import java.util.Objects; import org.apache.commons.collections4.OrderedIterator; /** - * A List implementation that is optimised for fast insertions and + * A {@code List} implementation that is optimised for fast insertions and * removals at any index in the list. *

        * This list implementation utilises a tree structure internally to ensure that * all insertions and removals are O(log n). This provides much faster performance - * than both an ArrayList and a LinkedList where elements + * than both an {@code ArrayList} and a {@code LinkedList} where elements * are inserted and removed repeatedly from anywhere in the list. *

        *

        @@ -47,14 +47,14 @@ import org.apache.commons.collections4.OrderedIterator; * LinkedList 5800 1 350 2 325 *

        *

        - * ArrayList is a good general purpose list implementation. - * It is faster than TreeList for most operations except inserting - * and removing in the middle of the list. ArrayList also uses less - * memory as TreeList uses one object per entry. + * {@code ArrayList} is a good general purpose list implementation. + * It is faster than {@code TreeList} for most operations except inserting + * and removing in the middle of the list. {@code ArrayList} also uses less + * memory as {@code TreeList} uses one object per entry. *

        *

        - * LinkedList is rarely a good choice of implementation. - * TreeList is almost always a good replacement for it, although it + * {@code LinkedList} is rarely a good choice of implementation. + * {@code TreeList} is almost always a good replacement for it, although it * does use slightly more memory. *

        * diff --git a/src/main/java/org/apache/commons/collections4/list/UnmodifiableList.java b/src/main/java/org/apache/commons/collections4/list/UnmodifiableList.java index bc37d73bd..09695eaf2 100644 --- a/src/main/java/org/apache/commons/collections4/list/UnmodifiableList.java +++ b/src/main/java/org/apache/commons/collections4/list/UnmodifiableList.java @@ -27,7 +27,7 @@ import org.apache.commons.collections4.iterators.UnmodifiableIterator; import org.apache.commons.collections4.iterators.UnmodifiableListIterator; /** - * Decorates another List to ensure it can't be altered. + * Decorates another {@code List} to ensure it can't be altered. *

        * This class is Serializable from Commons Collections 3.1. *

        diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java index 8efb96b4a..8198baf16 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java @@ -40,7 +40,7 @@ import org.apache.commons.collections4.iterators.EmptyMapIterator; * subclasses to override. *

        * This class implements all the features necessary for a subclass hash-based map. - * Key-value entries are stored in instances of the HashEntry class, + * Key-value entries are stored in instances of the {@code HashEntry} class, * which can be overridden and replaced. The iterators can similarly be replaced, * without the need to replace the KeySet, EntrySet and Values view classes. *

        @@ -407,7 +407,7 @@ public class AbstractHashedMap extends AbstractMap implements Iterab * Subclasses can override this to match differently. * * @param key1 the first key to compare passed in from outside - * @param key2 the second key extracted from the entry via entry.key + * @param key2 the second key extracted from the entry via {@code entry.key} * @return true if equal */ protected boolean isEqualKey(final Object key1, final Object key2) { @@ -420,7 +420,7 @@ public class AbstractHashedMap extends AbstractMap implements Iterab * Subclasses can override this to match differently. * * @param value1 the first value to compare passed in from outside - * @param value2 the second value extracted from the entry via getValue() + * @param value2 the second value extracted from the entry via {@code getValue()} * @return true if equal */ protected boolean isEqualValue(final Object value1, final Object value2) { @@ -468,7 +468,7 @@ public class AbstractHashedMap extends AbstractMap implements Iterab /** * Updates an existing key-value mapping to change the value. *

        - * This implementation calls setValue() on the entry. + * This implementation calls {@code setValue()} on the entry. * Subclasses could override to handle changes to the map. * * @param entry the entry to update @@ -502,9 +502,9 @@ public class AbstractHashedMap extends AbstractMap implements Iterab /** * Adds a new key-value mapping into this map. *

        - * This implementation calls createEntry(), addEntry() - * and checkCapacity(). - * It also handles changes to modCount and size. + * This implementation calls {@code createEntry()}, {@code addEntry()} + * and {@code checkCapacity()}. + * It also handles changes to {@code modCount} and {@code size}. * Subclasses could override to fully control adds to the map. * * @param hashIndex the index into the data array to store at @@ -554,8 +554,8 @@ public class AbstractHashedMap extends AbstractMap implements Iterab /** * Removes a mapping from the map. *

        - * This implementation calls removeEntry() and destroyEntry(). - * It also handles changes to modCount and size. + * This implementation calls {@code removeEntry()} and {@code destroyEntry()}. + * It also handles changes to {@code modCount} and {@code size}. * Subclasses could override to fully control removals from the map. * * @param entry the entry to remove @@ -690,11 +690,11 @@ public class AbstractHashedMap extends AbstractMap implements Iterab //----------------------------------------------------------------------- /** - * Gets the next field from a HashEntry. + * Gets the {@code next} field from a {@code HashEntry}. * Used in subclasses that have no visibility of the field. * * @param entry the entry to query, must not be null - * @return the next field of the entry + * @return the {@code next} field of the entry * @throws NullPointerException if the entry is null * @since 3.1 */ @@ -703,11 +703,11 @@ public class AbstractHashedMap extends AbstractMap implements Iterab } /** - * Gets the hashCode field from a HashEntry. + * Gets the {@code hashCode} field from a {@code HashEntry}. * Used in subclasses that have no visibility of the field. * * @param entry the entry to query, must not be null - * @return the hashCode field of the entry + * @return the {@code hashCode} field of the entry * @throws NullPointerException if the entry is null * @since 3.1 */ @@ -716,11 +716,11 @@ public class AbstractHashedMap extends AbstractMap implements Iterab } /** - * Gets the key field from a HashEntry. + * Gets the {@code key} field from a {@code HashEntry}. * Used in subclasses that have no visibility of the field. * * @param entry the entry to query, must not be null - * @return the key field of the entry + * @return the {@code key} field of the entry * @throws NullPointerException if the entry is null * @since 3.1 */ @@ -729,11 +729,11 @@ public class AbstractHashedMap extends AbstractMap implements Iterab } /** - * Gets the value field from a HashEntry. + * Gets the {@code value} field from a {@code HashEntry}. * Used in subclasses that have no visibility of the field. * * @param entry the entry to query, must not be null - * @return the value field of the entry + * @return the {@code value} field of the entry * @throws NullPointerException if the entry is null * @since 3.1 */ @@ -1065,9 +1065,9 @@ public class AbstractHashedMap extends AbstractMap implements Iterab /** * HashEntry used to store the data. *

        - * If you subclass AbstractHashedMap but not HashEntry + * If you subclass {@code AbstractHashedMap} but not {@code HashEntry} * then you will not be able to access the protected fields. - * The entryXxx() methods on AbstractHashedMap exist + * The {@code entryXxx()} methods on {@code AbstractHashedMap} exist * to provide the necessary access. */ protected static class HashEntry implements Map.Entry, KeyValue { @@ -1219,16 +1219,16 @@ public class AbstractHashedMap extends AbstractMap implements Iterab //----------------------------------------------------------------------- /** * Writes the map data to the stream. This method must be overridden if a - * subclass must be setup before put() is used. + * subclass must be setup before {@code put()} is used. *

        * Serialization is not one of the JDK's nicest topics. Normal serialization will * initialise the superclass before the subclass. Sometimes however, this isn't - * what you want, as in this case the put() method on read can be + * what you want, as in this case the {@code put()} method on read can be * affected by subclass state. *

        * The solution adopted here is to serialize the state data of this class in * this protected method. This method must be called by the - * writeObject() of the first serializable subclass. + * {@code writeObject()} of the first serializable subclass. *

        * Subclasses may override if they have a specific field that must be present * on read before this implementation will work. Generally, the read determines @@ -1249,19 +1249,19 @@ public class AbstractHashedMap extends AbstractMap implements Iterab /** * Reads the map data from the stream. This method must be overridden if a - * subclass must be setup before put() is used. + * subclass must be setup before {@code put()} is used. *

        * Serialization is not one of the JDK's nicest topics. Normal serialization will * initialise the superclass before the subclass. Sometimes however, this isn't - * what you want, as in this case the put() method on read can be + * what you want, as in this case the {@code put()} method on read can be * affected by subclass state. *

        * The solution adopted here is to deserialize the state data of this class in * this protected method. This method must be called by the - * readObject() of the first serializable subclass. + * {@code readObject()} of the first serializable subclass. *

        * Subclasses may override if the subclass has a specific field that must be present - * before put() or calculateThreshold() will work correctly. + * before {@code put()} or {@code calculateThreshold()} will work correctly. * * @param in the input stream * @throws IOException if an error occurs while reading from the stream @@ -1286,8 +1286,8 @@ public class AbstractHashedMap extends AbstractMap implements Iterab /** * Clones the map without cloning the keys or values. *

        - * To implement clone(), a subclass must implement the - * Cloneable interface and make this method public. + * To implement {@code clone()}, a subclass must implement the + * {@code Cloneable} interface and make this method public. * * @return a shallow clone * @throws InternalError if {@link AbstractMap#clone()} failed diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractInputCheckedMapDecorator.java b/src/main/java/org/apache/commons/collections4/map/AbstractInputCheckedMapDecorator.java index 45028cede..5dfe0043b 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractInputCheckedMapDecorator.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractInputCheckedMapDecorator.java @@ -66,7 +66,7 @@ abstract class AbstractInputCheckedMapDecorator //----------------------------------------------------------------------- /** - * Hook method called when a value is being set using setValue. + * Hook method called when a value is being set using {@code setValue}. *

        * An implementation may validate the value and throw an exception * or it may transform the value into another object. @@ -85,12 +85,12 @@ abstract class AbstractInputCheckedMapDecorator protected abstract V checkSetValue(V value); /** - * Hook method called to determine if checkSetValue has any effect. + * Hook method called to determine if {@code checkSetValue} has any effect. *

        - * An implementation should return false if the checkSetValue method + * An implementation should return false if the {@code checkSetValue} method * has no effect as this optimises the implementation. *

        - * This implementation returns true. + * This implementation returns {@code true}. * * @return true always */ diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java index 2fb135680..25b980b0d 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java @@ -34,7 +34,7 @@ import org.apache.commons.collections4.iterators.EmptyOrderedMapIterator; *

        * This class implements all the features necessary for a subclass linked * hash-based map. Key-value entries are stored in instances of the - * LinkEntry class which can be overridden and replaced. + * {@code LinkEntry} class which can be overridden and replaced. * The iterators can similarly be replaced, without the need to replace the KeySet, * EntrySet and Values view classes. *

        @@ -45,17 +45,17 @@ import org.apache.commons.collections4.iterators.EmptyOrderedMapIterator; *

        *

        * This implementation maintains order by original insertion, but subclasses - * may work differently. The OrderedMap interface is implemented + * may work differently. The {@code OrderedMap} interface is implemented * to provide access to bidirectional iteration and extra convenience methods. *

        *

        - * The orderedMapIterator() method provides direct access to a + * The {@code orderedMapIterator()} method provides direct access to a * bidirectional iterator. The iterators from the other views can also be cast - * to OrderedIterator if required. + * to {@code OrderedIterator} if required. *

        *

        * All the available iterators can be reset back to the start by casting to - * ResettableIterator and calling reset(). + * {@code ResettableIterator} and calling {@code reset()}. *

        *

        * The implementation is also designed to be subclassed, with lots of useful @@ -317,11 +317,11 @@ public abstract class AbstractLinkedMap extends AbstractHashedMap im //----------------------------------------------------------------------- /** - * Gets the before field from a LinkEntry. + * Gets the {@code before} field from a {@code LinkEntry}. * Used in subclasses that have no visibility of the field. * * @param entry the entry to query, must not be null - * @return the before field of the entry + * @return the {@code before} field of the entry * @throws NullPointerException if the entry is null * @since 3.1 */ @@ -330,11 +330,11 @@ public abstract class AbstractLinkedMap extends AbstractHashedMap im } /** - * Gets the after field from a LinkEntry. + * Gets the {@code after} field from a {@code LinkEntry}. * Used in subclasses that have no visibility of the field. * * @param entry the entry to query, must not be null - * @return the after field of the entry + * @return the {@code after} field of the entry * @throws NullPointerException if the entry is null * @since 3.1 */ @@ -516,9 +516,9 @@ public abstract class AbstractLinkedMap extends AbstractHashedMap im /** * LinkEntry that stores the data. *

        - * If you subclass AbstractLinkedMap but not LinkEntry + * If you subclass {@code AbstractLinkedMap} but not {@code LinkEntry} * then you will not be able to access the protected fields. - * The entryXxx() methods on AbstractLinkedMap exist + * The {@code entryXxx()} methods on {@code AbstractLinkedMap} exist * to provide the necessary access. */ protected static class LinkEntry extends HashEntry { diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java index 26c577bc9..794c535cc 100644 --- a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java +++ b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java @@ -42,7 +42,7 @@ import org.apache.commons.collections4.keyvalue.DefaultMapEntry; *

        * This class implements all the features necessary for a subclass reference * hash-based map. Key-value entries are stored in instances of the - * ReferenceEntry class which can be overridden and replaced. + * {@code ReferenceEntry} class which can be overridden and replaced. * The iterators can similarly be replaced, without the need to replace the KeySet, * EntrySet and Values view classes. *

        @@ -52,7 +52,7 @@ import org.apache.commons.collections4.keyvalue.DefaultMapEntry; * need for unusual subclasses is here. *

        *

        - * When you construct an AbstractReferenceMap, you can specify what + * When you construct an {@code AbstractReferenceMap}, you can specify what * kind of references are used to store the map's keys and values. * If non-hard references are used, then the garbage collector can remove * mappings if a key or value becomes unreachable, or if the JVM's memory is @@ -64,23 +64,23 @@ import org.apache.commons.collections4.keyvalue.DefaultMapEntry; * The keys can be configured to be weak but the values hard, * in which case this class will behave like a * - * WeakHashMap. However, you can also specify hard keys and + * {@code WeakHashMap}. However, you can also specify hard keys and * weak values, or any other combination. The default constructor uses * hard keys and soft values, providing a memory-sensitive cache. *

        *

        * This {@link Map} implementation does not allow null elements. * Attempting to add a null key or value to the map will raise a - * NullPointerException. + * {@code NullPointerException}. *

        *

        * All the available iterators can be reset back to the start by casting to - * ResettableIterator and calling reset(). + * {@code ResettableIterator} and calling {@code reset()}. *

        *

        * This implementation is not synchronized. * You can use {@link java.util.Collections#synchronizedMap} to - * provide synchronized access to a ReferenceMap. + * provide synchronized access to a {@code ReferenceMap}. *

        * * @param the type of the keys in this map @@ -317,8 +317,8 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap /** * Returns a set view of this map's entries. - * An iterator returned entry is valid until next() is called again. - * The setValue() method on the toArray entries has no effect. + * An iterator returned entry is valid until {@code next()} is called again. + * The {@code setValue()} method on the {@code toArray} entries has no effect. * * @return a set view of this map's entries */ @@ -457,7 +457,7 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap * before comparison. * * @param key1 the first key to compare passed in from outside - * @param key2 the second key extracted from the entry via entry.key + * @param key2 the second key extracted from the entry via {@code entry.key} * @return true if equal */ @Override @@ -664,8 +664,8 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap /** * Compares this map entry to another. *

        - * This implementation uses isEqualKey and - * isEqualValue on the main map for comparison. + * This implementation uses {@code isEqualKey} and + * {@code isEqualValue} on the main map for comparison. * * @param obj the other map entry to compare to * @return true if equal, false if not @@ -694,7 +694,7 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap /** * Gets the hashcode of the entry using temporary hard references. *

        - * This implementation uses hashEntry on the main map. + * This implementation uses {@code hashEntry} on the main map. * * @return the hashcode of the entry */ @@ -1008,12 +1008,12 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap *

        * Serialization is not one of the JDK's nicest topics. Normal serialization will * initialise the superclass before the subclass. Sometimes however, this isn't - * what you want, as in this case the put() method on read can be + * what you want, as in this case the {@code put()} method on read can be * affected by subclass state. *

        * The solution adopted here is to serialize the state data of this class in * this protected method. This method must be called by the - * writeObject() of the first serializable subclass. + * {@code writeObject()} of the first serializable subclass. *

        * Subclasses may override if they have a specific field that must be present * on read before this implementation will work. Generally, the read determines @@ -1042,15 +1042,15 @@ public abstract class AbstractReferenceMap extends AbstractHashedMap *

        * Serialization is not one of the JDK's nicest topics. Normal serialization will * initialise the superclass before the subclass. Sometimes however, this isn't - * what you want, as in this case the put() method on read can be + * what you want, as in this case the {@code put()} method on read can be * affected by subclass state. *

        * The solution adopted here is to deserialize the state data of this class in * this protected method. This method must be called by the - * readObject() of the first serializable subclass. + * {@code readObject()} of the first serializable subclass. *

        * Subclasses may override if the subclass has a specific field that must be present - * before put() or calculateThreshold() will work correctly. + * before {@code put()} or {@code calculateThreshold()} will work correctly. * * @param in the input stream * @throws IOException if an error occurs while reading from the stream diff --git a/src/main/java/org/apache/commons/collections4/map/CaseInsensitiveMap.java b/src/main/java/org/apache/commons/collections4/map/CaseInsensitiveMap.java index e57388fbe..58b4c7555 100644 --- a/src/main/java/org/apache/commons/collections4/map/CaseInsensitiveMap.java +++ b/src/main/java/org/apache/commons/collections4/map/CaseInsensitiveMap.java @@ -23,7 +23,7 @@ import java.io.Serializable; import java.util.Map; /** - * A case-insensitive Map. + * A case-insensitive {@code Map}. *

        * Before keys are added to the map or compared to other existing keys, they are converted * to all lowercase in a locale-independent fashion by using information from the Unicode @@ -33,7 +33,7 @@ import java.util.Map; * Null keys are supported. *

        *

        - * The keySet() method returns all lowercase keys, or nulls. + * The {@code keySet()} method returns all lowercase keys, or nulls. *

        *

        * Example: @@ -46,12 +46,12 @@ import java.util.Map; * map.put("one", "Four"); *

        *

        - * The example above creates a CaseInsensitiveMap with three entries. + * The example above creates a {@code CaseInsensitiveMap} with three entries. *

        *

        - * map.get(null) returns "Three" and map.get("ONE") - * returns "Four". The Set returned by keySet() - * equals {"one", "two", null}. + * {@code map.get(null)} returns {@code "Three"} and {@code map.get("ONE")} + * returns {@code "Four".} The {@code Set} returned by {@code keySet()} + * equals {@code {"one", "two", null}.} *

        *

        * This map will violate the detail of various Map and map view contracts. diff --git a/src/main/java/org/apache/commons/collections4/map/CompositeMap.java b/src/main/java/org/apache/commons/collections4/map/CompositeMap.java index 170127ebd..e3feed60a 100644 --- a/src/main/java/org/apache/commons/collections4/map/CompositeMap.java +++ b/src/main/java/org/apache/commons/collections4/map/CompositeMap.java @@ -155,7 +155,7 @@ public class CompositeMap extends AbstractIterableMap implements Ser * Remove a Map from the composite. * * @param map the Map to be removed from the composite - * @return The removed Map or null if map is not in the composite + * @return The removed Map or {@code null} if map is not in the composite */ @SuppressWarnings("unchecked") public synchronized Map removeComposited(final Map map) { @@ -174,7 +174,7 @@ public class CompositeMap extends AbstractIterableMap implements Ser //----------------------------------------------------------------------- /** - * Calls clear() on all composited Maps. + * Calls {@code clear()} on all composited Maps. * * @throws UnsupportedOperationException if any of the composited Maps do not support clear() */ @@ -239,7 +239,7 @@ public class CompositeMap extends AbstractIterableMap implements Ser /** * Returns a set view of the mappings contained in this map. Each element - * in the returned set is a Map.Entry. The set is backed by the + * in the returned set is a {@code Map.Entry}. The set is backed by the * map, so changes to the map are reflected in the set, and vice-versa. * If the map is modified while an iteration over the set is in progress, * the results of the iteration are undefined. The set supports element @@ -248,7 +248,7 @@ public class CompositeMap extends AbstractIterableMap implements Ser * {@code retainAll} and {@code clear} operations. It does not support * the {@code add} or {@code addAll} operations. *

        - * This implementation returns a CompositeSet which + * This implementation returns a {@code CompositeSet} which * composites the entry sets from all of the composited maps. * * @see CompositeSet @@ -322,7 +322,7 @@ public class CompositeMap extends AbstractIterableMap implements Ser * {@code removeAll} {@code retainAll}, and {@code clear} operations. * It does not support the add or {@code addAll} operations. *

        - * This implementation returns a CompositeSet which + * This implementation returns a {@code CompositeSet} which * composites the key sets from all of the composited maps. * * @return a set view of the keys contained in this map. @@ -403,7 +403,7 @@ public class CompositeMap extends AbstractIterableMap implements Ser * Removes the mapping for this key from this map if it is present * (optional operation). More formally, if this map contains a mapping * from key {@code k} to value {@code v} such that - * (key==null ? k==null : key.equals(k)), that mapping + * {@code (key==null ? k==null : key.equals(k))}, that mapping * is removed. (The map can contain at most one such mapping.) * *

        Returns the value to which the map previously associated the key, or diff --git a/src/main/java/org/apache/commons/collections4/map/DefaultedMap.java b/src/main/java/org/apache/commons/collections4/map/DefaultedMap.java index f7211b805..e489d82d5 100644 --- a/src/main/java/org/apache/commons/collections4/map/DefaultedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/DefaultedMap.java @@ -30,7 +30,7 @@ import org.apache.commons.collections4.functors.ConstantTransformer; import org.apache.commons.collections4.functors.FactoryTransformer; /** - * Decorates another Map returning a default value if the map + * Decorates another {@code Map} returning a default value if the map * does not contain the requested key. *

        * When the {@link #get(Object)} method is called with a key that does not @@ -141,8 +141,8 @@ public class DefaultedMap extends AbstractMapDecorator implements Se //----------------------------------------------------------------------- /** - * Constructs a new empty DefaultedMap that decorates - * a HashMap. + * Constructs a new empty {@code DefaultedMap} that decorates + * a {@code HashMap}. *

        * The object passed in will be returned by the map whenever an * unknown key is requested. @@ -154,7 +154,7 @@ public class DefaultedMap extends AbstractMapDecorator implements Se } /** - * Constructs a new empty DefaultedMap that decorates a HashMap. + * Constructs a new empty {@code DefaultedMap} that decorates a {@code HashMap}. * * @param defaultValueTransformer transformer to use to generate missing values. */ diff --git a/src/main/java/org/apache/commons/collections4/map/FixedSizeMap.java b/src/main/java/org/apache/commons/collections4/map/FixedSizeMap.java index bbeac4624..0895894ef 100644 --- a/src/main/java/org/apache/commons/collections4/map/FixedSizeMap.java +++ b/src/main/java/org/apache/commons/collections4/map/FixedSizeMap.java @@ -29,7 +29,7 @@ import org.apache.commons.collections4.collection.UnmodifiableCollection; import org.apache.commons.collections4.set.UnmodifiableSet; /** - * Decorates another Map to fix the size, preventing add/remove. + * Decorates another {@code Map} to fix the size, preventing add/remove. *

        * Any action that would change the size of the map is disallowed. * The put method is allowed to change the value associated with an existing diff --git a/src/main/java/org/apache/commons/collections4/map/FixedSizeSortedMap.java b/src/main/java/org/apache/commons/collections4/map/FixedSizeSortedMap.java index 15fe47070..2ac244086 100644 --- a/src/main/java/org/apache/commons/collections4/map/FixedSizeSortedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/FixedSizeSortedMap.java @@ -31,7 +31,7 @@ import org.apache.commons.collections4.collection.UnmodifiableCollection; import org.apache.commons.collections4.set.UnmodifiableSet; /** - * Decorates another SortedMap to fix the size blocking add/remove. + * Decorates another {@code SortedMap} to fix the size blocking add/remove. *

        * Any action that would change the size of the map is disallowed. * The put method is allowed to change the value associated with an existing diff --git a/src/main/java/org/apache/commons/collections4/map/Flat3Map.java b/src/main/java/org/apache/commons/collections4/map/Flat3Map.java index c506c531f..fbb71c7f1 100644 --- a/src/main/java/org/apache/commons/collections4/map/Flat3Map.java +++ b/src/main/java/org/apache/commons/collections4/map/Flat3Map.java @@ -35,7 +35,7 @@ import org.apache.commons.collections4.iterators.EmptyIterator; import org.apache.commons.collections4.iterators.EmptyMapIterator; /** - * A Map implementation that stores data in simple fields until + * A {@code Map} implementation that stores data in simple fields until * the size is greater than 3. *

        * This map is designed for performance and can outstrip HashMap. @@ -64,7 +64,7 @@ import org.apache.commons.collections4.iterators.EmptyMapIterator; * This is because it contains no complex objects or arrays which slow the progress. *

        *

        - * Do not use Flat3Map if the size is likely to grow beyond 3. + * Do not use {@code Flat3Map} if the size is likely to grow beyond 3. *

        *

        * Note that Flat3Map is not synchronized and is not thread-safe. diff --git a/src/main/java/org/apache/commons/collections4/map/HashedMap.java b/src/main/java/org/apache/commons/collections4/map/HashedMap.java index e0ec9d095..3c1ae1cf5 100644 --- a/src/main/java/org/apache/commons/collections4/map/HashedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/HashedMap.java @@ -23,8 +23,8 @@ import java.io.Serializable; import java.util.Map; /** - * A Map implementation that is a general purpose alternative - * to HashMap. + * A {@code Map} implementation that is a general purpose alternative + * to {@code HashMap}. *

        * This implementation improves on the JDK1.4 HashMap by adding the * {@link org.apache.commons.collections4.MapIterator MapIterator} diff --git a/src/main/java/org/apache/commons/collections4/map/LRUMap.java b/src/main/java/org/apache/commons/collections4/map/LRUMap.java index fb83ad208..8fbf872a0 100644 --- a/src/main/java/org/apache/commons/collections4/map/LRUMap.java +++ b/src/main/java/org/apache/commons/collections4/map/LRUMap.java @@ -25,7 +25,7 @@ import java.util.Map; import org.apache.commons.collections4.BoundedMap; /** - * A Map implementation with a fixed maximum size which removes + * A {@code Map} implementation with a fixed maximum size which removes * the least recently used entry if an entry is added when full. *

        * The least recently used algorithm works on the get and put operations only. @@ -42,21 +42,21 @@ import org.apache.commons.collections4.BoundedMap; * {@link org.apache.commons.collections4.MapIterator MapIterator} or {@link #entrySet()} iterator. *

        *

        - * The map implements OrderedMap and entries may be queried using - * the bidirectional OrderedMapIterator. The order returned is + * The map implements {@code OrderedMap} and entries may be queried using + * the bidirectional {@code OrderedMapIterator}. The order returned is * least recently used to most recently used. Iterators from map views can - * also be cast to OrderedIterator if required. + * also be cast to {@code OrderedIterator} if required. *

        *

        * All the available iterators can be reset back to the start by casting to - * ResettableIterator and calling reset(). + * {@code ResettableIterator} and calling {@code reset()}. *

        *

        * Note that LRUMap is not synchronized and is not thread-safe. * If you wish to use this map from multiple threads concurrently, you must use * appropriate synchronization. The simplest approach is to wrap this map * using {@link java.util.Collections#synchronizedMap(Map)}. This class may throw - * NullPointerException's when accessed by concurrent threads. + * {@code NullPointerException}'s when accessed by concurrent threads. *

        * * @param the type of the keys in this map @@ -308,7 +308,7 @@ public class LRUMap * discard an entry or not using {@link #removeLRU(AbstractLinkedMap.LinkEntry)}. *

        * From Commons Collections 3.1 this method uses {@link #isFull()} rather - * than accessing size and maxSize directly. + * than accessing {@code size} and {@code maxSize} directly. * It also handles the scanUntilRemovable functionality. * * @param hashIndex the index into the data array to store at @@ -442,7 +442,7 @@ public class LRUMap /** * Returns true if this map is full and no new mappings can be added. * - * @return true if the map is full + * @return {@code true} if the map is full */ @Override public boolean isFull() { @@ -505,7 +505,7 @@ public class LRUMap } /** - * Writes the data necessary for put() to work in deserialization. + * Writes the data necessary for {@code put()} to work in deserialization. * * @param out the output stream * @throws IOException if an error occurs while writing to the stream @@ -517,7 +517,7 @@ public class LRUMap } /** - * Reads the data necessary for put() to work in the superclass. + * Reads the data necessary for {@code put()} to work in the superclass. * * @param in the input stream * @throws IOException if an error occurs while reading from the stream diff --git a/src/main/java/org/apache/commons/collections4/map/LazyMap.java b/src/main/java/org/apache/commons/collections4/map/LazyMap.java index 1317c693a..d12ce496f 100644 --- a/src/main/java/org/apache/commons/collections4/map/LazyMap.java +++ b/src/main/java/org/apache/commons/collections4/map/LazyMap.java @@ -28,7 +28,7 @@ import org.apache.commons.collections4.Transformer; import org.apache.commons.collections4.functors.FactoryTransformer; /** - * Decorates another Map to create objects in the map on demand. + * Decorates another {@code Map} to create objects in the map on demand. *

        * When the {@link #get(Object)} method is called with a key that does not * exist in the map, the factory is used to create the object. The created @@ -48,8 +48,8 @@ import org.apache.commons.collections4.functors.FactoryTransformer; * * *

        - * After the above code is executed, date will refer to - * a new Date instance. Furthermore, that Date + * After the above code is executed, {@code date} will refer to + * a new {@code Date} instance. Furthermore, that {@code Date} * instance is mapped to the "NOW" key in the map. *

        *

        diff --git a/src/main/java/org/apache/commons/collections4/map/LazySortedMap.java b/src/main/java/org/apache/commons/collections4/map/LazySortedMap.java index 4d97d4682..36418e737 100644 --- a/src/main/java/org/apache/commons/collections4/map/LazySortedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/LazySortedMap.java @@ -23,7 +23,7 @@ import org.apache.commons.collections4.Factory; import org.apache.commons.collections4.Transformer; /** - * Decorates another SortedMap to create objects in the map on demand. + * Decorates another {@code SortedMap} to create objects in the map on demand. *

        * When the {@link #get(Object)} method is called with a key that does not * exist in the map, the factory is used to create the object. The created @@ -44,8 +44,8 @@ import org.apache.commons.collections4.Transformer; * * *

        - * After the above code is executed, date will refer to - * a new Date instance. Furthermore, that Date + * After the above code is executed, {@code date} will refer to + * a new {@code Date} instance. Furthermore, that {@code Date} * instance is mapped to the "NOW" key in the map. *

        *

        diff --git a/src/main/java/org/apache/commons/collections4/map/LinkedMap.java b/src/main/java/org/apache/commons/collections4/map/LinkedMap.java index ad4047c17..b2953b675 100644 --- a/src/main/java/org/apache/commons/collections4/map/LinkedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/LinkedMap.java @@ -33,23 +33,23 @@ import org.apache.commons.collections4.iterators.UnmodifiableListIterator; import org.apache.commons.collections4.list.UnmodifiableList; /** - * A Map implementation that maintains the order of the entries. + * A {@code Map} implementation that maintains the order of the entries. * In this implementation order is maintained by original insertion. *

        * This implementation improves on the JDK1.4 LinkedHashMap by adding the * {@link org.apache.commons.collections4.MapIterator MapIterator} * functionality, additional convenience methods and allowing - * bidirectional iteration. It also implements OrderedMap. + * bidirectional iteration. It also implements {@code OrderedMap}. * In addition, non-interface methods are provided to access the map by index. *

        *

        - * The orderedMapIterator() method provides direct access to a + * The {@code orderedMapIterator()} method provides direct access to a * bidirectional iterator. The iterators from the other views can also be cast - * to OrderedIterator if required. + * to {@code OrderedIterator} if required. *

        *

        * All the available iterators can be reset back to the start by casting to - * ResettableIterator and calling reset(). + * {@code ResettableIterator} and calling {@code reset()}. *

        *

        * The implementation is also designed to be subclassed, with lots of useful @@ -190,8 +190,8 @@ public class LinkedMap extends AbstractLinkedMap implements Serializ * Removes the element at the specified index. * * @param index the index of the object to remove - * @return the previous value corresponding the key, - * or null if none existed + * @return the previous value corresponding the {@code key}, + * or {@code null} if none existed * @throws IndexOutOfBoundsException if the index is invalid */ public V remove(final int index) { diff --git a/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java b/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java index 468cc2b4b..46b8a68d3 100644 --- a/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java @@ -40,12 +40,12 @@ import org.apache.commons.collections4.keyvalue.AbstractMapEntry; import org.apache.commons.collections4.list.UnmodifiableList; /** - * Decorates a Map to ensure that the order of addition is retained - * using a List to maintain order. + * Decorates a {@code Map} to ensure that the order of addition is retained + * using a {@code List} to maintain order. *

        * The order will be used via the iterators and toArray methods on the views. - * The order is also returned by the MapIterator. - * The orderedMapIterator() method accesses an iterator that can + * The order is also returned by the {@code MapIterator}. + * The {@code orderedMapIterator()} method accesses an iterator that can * iterate both forwards and backwards through the map. * In addition, non-interface methods are provided to access the map by index. *

        @@ -64,12 +64,12 @@ import org.apache.commons.collections4.list.UnmodifiableList; * Note that ListOrderedMap doesn't work with * {@link java.util.IdentityHashMap IdentityHashMap}, {@link CaseInsensitiveMap}, * or similar maps that violate the general contract of {@link java.util.Map}. - * The ListOrderedMap (or, more precisely, the underlying List) + * The {@code ListOrderedMap} (or, more precisely, the underlying {@code List}) * is relying on {@link Object#equals(Object) equals()}. This is fine, as long as the - * decorated Map is also based on {@link Object#equals(Object) equals()}, + * decorated {@code Map} is also based on {@link Object#equals(Object) equals()}, * and {@link Object#hashCode() hashCode()}, which * {@link java.util.IdentityHashMap IdentityHashMap}, and - * {@link CaseInsensitiveMap} don't: The former uses ==, and + * {@link CaseInsensitiveMap} don't: The former uses {@code ==}, and * the latter uses {@link Object#equals(Object) equals()} on a lower-cased * key. *

        @@ -94,7 +94,7 @@ public class ListOrderedMap /** * Factory method to create an ordered map. *

        - * An ArrayList is used to retain order. + * An {@code ArrayList} is used to retain order. * * @param the key type * @param the value type @@ -109,8 +109,8 @@ public class ListOrderedMap //----------------------------------------------------------------------- /** - * Constructs a new empty ListOrderedMap that decorates - * a HashMap. + * Constructs a new empty {@code ListOrderedMap} that decorates + * a {@code HashMap}. * * @since 3.1 */ @@ -479,7 +479,7 @@ public class ListOrderedMap * Removes the element at the specified index. * * @param index the index of the object to remove - * @return the removed value, or null if none existed + * @return the removed value, or {@code null} if none existed * @throws IndexOutOfBoundsException if the index is invalid */ public V remove(final int index) { diff --git a/src/main/java/org/apache/commons/collections4/map/MultiKeyMap.java b/src/main/java/org/apache/commons/collections4/map/MultiKeyMap.java index d6859d3de..f96c85f26 100644 --- a/src/main/java/org/apache/commons/collections4/map/MultiKeyMap.java +++ b/src/main/java/org/apache/commons/collections4/map/MultiKeyMap.java @@ -27,34 +27,34 @@ import org.apache.commons.collections4.MapIterator; import org.apache.commons.collections4.keyvalue.MultiKey; /** - * A Map implementation that uses multiple keys to map the value. + * A {@code Map} implementation that uses multiple keys to map the value. *

        * This class is the most efficient way to uses multiple keys to map to a value. * The best way to use this class is via the additional map-style methods. - * These provide get, containsKey, put and - * remove for individual keys which operate without extra object creation. + * These provide {@code get}, {@code containsKey}, {@code put} and + * {@code remove} for individual keys which operate without extra object creation. *

        *

        * The additional methods are the main interface of this map. - * As such, you will not normally hold this map in a variable of type Map. + * As such, you will not normally hold this map in a variable of type {@code Map}. *

        *

        * The normal map methods take in and return a {@link MultiKey}. - * If you try to use put() with any other object type a - * ClassCastException is thrown. If you try to use null as - * the key in put() a NullPointerException is thrown. + * If you try to use {@code put()} with any other object type a + * {@code ClassCastException} is thrown. If you try to use {@code null} as + * the key in {@code put()} a {@code NullPointerException} is thrown. *

        *

        - * This map is implemented as a decorator of a AbstractHashedMap which + * This map is implemented as a decorator of a {@code AbstractHashedMap} which * enables extra behaviour to be added easily. *

        *
          - *
        • MultiKeyMap.decorate(new LinkedMap()) creates an ordered map. - *
        • MultiKeyMap.decorate(new LRUMap()) creates an least recently used map. - *
        • MultiKeyMap.decorate(new ReferenceMap()) creates a garbage collector sensitive map. + *
        • {@code MultiKeyMap.decorate(new LinkedMap())} creates an ordered map. + *
        • {@code MultiKeyMap.decorate(new LRUMap())} creates an least recently used map. + *
        • {@code MultiKeyMap.decorate(new ReferenceMap())} creates a garbage collector sensitive map. *
        *

        - * Note that IdentityMap and ReferenceIdentityMap are unsuitable + * Note that {@code IdentityMap} and {@code ReferenceIdentityMap} are unsuitable * for use as the key comparison would work on the whole MultiKey, not the elements within. *

        *

        @@ -113,7 +113,7 @@ public class MultiKeyMap extends AbstractMapDecoratorHashedMap. + * Constructs a new MultiKeyMap that decorates a {@code HashedMap}. */ public MultiKeyMap() { this(new HashedMap, V>()); @@ -714,7 +714,7 @@ public class MultiKeyMap extends AbstractMapDecorator - * This method removes all the mappings where the MultiKey + * This method removes all the mappings where the {@code MultiKey} * has one or more keys, and the first matches that specified. * * @param key1 the first key @@ -737,7 +737,7 @@ public class MultiKeyMap extends AbstractMapDecorator - * This method removes all the mappings where the MultiKey + * This method removes all the mappings where the {@code MultiKey} * has two or more keys, and the first two match those specified. * * @param key1 the first key @@ -762,7 +762,7 @@ public class MultiKeyMap extends AbstractMapDecorator - * This method removes all the mappings where the MultiKey + * This method removes all the mappings where the {@code MultiKey} * has three or more keys, and the first three match those specified. * * @param key1 the first key @@ -789,7 +789,7 @@ public class MultiKeyMap extends AbstractMapDecorator - * This method removes all the mappings where the MultiKey + * This method removes all the mappings where the {@code MultiKey} * has four or more keys, and the first four match those specified. * * @param key1 the first key diff --git a/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java b/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java index 0b8c05cb9..c0aa64b91 100644 --- a/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java +++ b/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java @@ -42,7 +42,7 @@ import org.apache.commons.collections4.iterators.TransformIterator; * A MultiValueMap decorates another map, allowing it to have * more than one value for a key. *

        - * A MultiMap is a Map with slightly different semantics. + * A {@code MultiMap} 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. *

        @@ -52,9 +52,9 @@ import org.apache.commons.collections4.iterators.TransformIterator; *

        *

        * In addition, this implementation allows the type of collection used - * for the values to be controlled. By default, an ArrayList - * is used, however a Class to instantiate may be specified, - * or a factory that returns a Collection instance. + * for the values to be controlled. By default, an {@code ArrayList} + * is used, however a {@code Class} to instantiate may be specified, + * or a factory that returns a {@code Collection} instance. *

        *

        * Note that MultiValueMap is not synchronized and is not thread-safe. @@ -95,8 +95,8 @@ public class MultiValueMap extends AbstractMapDecorator impleme } /** - * Creates a map which decorates the given map and - * maps keys to collections of type collectionClass. + * Creates a map which decorates the given {@code map} and + * maps keys to collections of type {@code collectionClass}. * * @param the key type * @param the value type @@ -112,8 +112,8 @@ public class MultiValueMap extends AbstractMapDecorator impleme } /** - * Creates a map which decorates the given map and - * creates the value collections using the supplied collectionFactory. + * Creates a map which decorates the given {@code map} and + * creates the value collections using the supplied {@code collectionFactory}. * * @param the key type * @param the value type @@ -130,8 +130,8 @@ public class MultiValueMap extends AbstractMapDecorator impleme //----------------------------------------------------------------------- /** - * Creates a MultiValueMap based on a HashMap and - * storing the multiple values in an ArrayList. + * Creates a MultiValueMap based on a {@code HashMap} and + * storing the multiple values in an {@code ArrayList}. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public MultiValueMap() { @@ -139,8 +139,8 @@ public class MultiValueMap extends AbstractMapDecorator impleme } /** - * Creates a MultiValueMap which decorates the given map and - * creates the value collections using the supplied collectionFactory. + * Creates a MultiValueMap which decorates the given {@code map} and + * creates the value collections using the supplied {@code collectionFactory}. * * @param the collection class type * @param map the map to decorate @@ -206,8 +206,8 @@ public class MultiValueMap extends AbstractMapDecorator impleme * The item is removed from the collection mapped to the specified key. * Other values attached to that key are unaffected. *

        - * If the last value for a key is removed, null will be returned - * from a subsequent get(key). + * If the last value for a key is removed, {@code null} will be returned + * from a subsequent {@code get(key)}. * * @param key the key to remove from * @param value the value to remove @@ -254,7 +254,7 @@ public class MultiValueMap extends AbstractMapDecorator impleme /** * Adds the value to the collection associated with the specified key. *

        - * Unlike a normal Map the previous value is not replaced. + * Unlike a normal {@code Map} the previous value is not replaced. * Instead the new value is added to the collection stored against the key. * * @param key the key to store against @@ -285,9 +285,9 @@ public class MultiValueMap extends AbstractMapDecorator impleme * correctly handled. *

        * If you call this method with a normal map, each entry is - * added using put(Object,Object). + * added using {@code put(Object,Object)}. * If you call this method with a multi map, each entry is - * added using putAll(Object,Collection). + * added using {@code putAll(Object,Collection)}. * * @param map the map to copy (either a normal or multi map) */ @@ -350,7 +350,7 @@ public class MultiValueMap extends AbstractMapDecorator impleme /** * Gets the collection mapped to the specified key. - * This method is a convenience method to typecast the result of get(key). + * This method is a convenience method to typecast the result of {@code get(key)}. * * @param key the key to retrieve * @return the collection mapped to the key, null if no mapping diff --git a/src/main/java/org/apache/commons/collections4/map/PassiveExpiringMap.java b/src/main/java/org/apache/commons/collections4/map/PassiveExpiringMap.java index ab911153a..9dfbf1ae4 100644 --- a/src/main/java/org/apache/commons/collections4/map/PassiveExpiringMap.java +++ b/src/main/java/org/apache/commons/collections4/map/PassiveExpiringMap.java @@ -29,7 +29,7 @@ import java.util.Set; import java.util.concurrent.TimeUnit; /** - * Decorates a Map to evict expired entries once their expiration + * Decorates a {@code Map} to evict expired entries once their expiration * time has been reached. *

        * When putting a key-value pair in the map this decorator uses a @@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit; * When accessing the mapped value for a key, its expiration time is checked, * and if it is a negative value or if it is greater than the current time, the * mapped value is returned. Otherwise, the key is removed from the decorated - * map, and null is returned. + * map, and {@code null} is returned. *

        *

        * When invoking methods that involve accessing the entire map contents (i.e @@ -114,7 +114,7 @@ public class PassiveExpiringMap * before it expires. A negative value results in entries that * NEVER expire. A zero value results in entries that ALWAYS * expire. - * @param timeUnit the unit of time for the timeToLive + * @param timeUnit the unit of time for the {@code timeToLive} * parameter, must not be null. * @throws NullPointerException if the time unit is null. */ @@ -186,7 +186,7 @@ public class PassiveExpiringMap * @param timeToLive the constant amount of time an entry is available * before it expires. A negative value results in entries that NEVER * expire. A zero value results in entries that ALWAYS expire. - * @param timeUnit the unit of time for the timeToLive + * @param timeUnit the unit of time for the {@code timeToLive} * parameter, must not be null. * @throws NullPointerException if the time unit is null. */ @@ -281,7 +281,7 @@ public class PassiveExpiringMap * @param timeToLive the constant amount of time an entry is available * before it expires. A negative value results in entries that NEVER * expire. A zero value results in entries that ALWAYS expire. - * @param timeUnit the unit of time for the timeToLive + * @param timeUnit the unit of time for the {@code timeToLive} * parameter, must not be null. * @throws NullPointerException if the time unit is null. */ @@ -300,7 +300,7 @@ public class PassiveExpiringMap * @param timeToLive the constant amount of time an entry is available * before it expires. A negative value results in entries that NEVER * expire. A zero value results in entries that ALWAYS expire. - * @param timeUnit the unit of time for the timeToLive + * @param timeUnit the unit of time for the {@code timeToLive} * parameter, must not be null. * @param map the map to decorate, must not be null. * @throws NullPointerException if the map or time unit is null. @@ -384,15 +384,15 @@ public class PassiveExpiringMap } /** - * Determines if the given expiration time is less than now. + * Determines if the given expiration time is less than {@code now}. * * @param now the time in milliseconds used to compare against the * expiration time. * @param expirationTimeObject the expiration time value retrieved from * {@link #expirationMap}, can be null. - * @return true if expirationTimeObject is ≥ 0 - * and expirationTimeObject < now. - * false otherwise. + * @return {@code true} if {@code expirationTimeObject} is ≥ 0 + * and {@code expirationTimeObject} < {@code now}. + * {@code false} otherwise. */ private boolean isExpired(final long now, final Long expirationTimeObject) { if (expirationTimeObject != null) { @@ -457,7 +457,7 @@ public class PassiveExpiringMap /** * Removes all entries in the map whose expiration time is less than - * now. The exceptions are entries with negative expiration + * {@code now}. The exceptions are entries with negative expiration * times; those entries are never removed. * * @see #isExpired(long, Long) @@ -477,7 +477,7 @@ public class PassiveExpiringMap /** * Removes the entry with the given key if the entry's expiration time is - * less than now. If the entry has a negative expiration time, + * less than {@code now}. If the entry has a negative expiration time, * the entry is never removed. */ private void removeIfExpired(final Object key, final long now) { diff --git a/src/main/java/org/apache/commons/collections4/map/PredicatedMap.java b/src/main/java/org/apache/commons/collections4/map/PredicatedMap.java index 7c1b69aa2..01e125ebb 100644 --- a/src/main/java/org/apache/commons/collections4/map/PredicatedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/PredicatedMap.java @@ -26,7 +26,7 @@ import java.util.Map; import org.apache.commons.collections4.Predicate; /** - * Decorates another Map to validate that additions + * Decorates another {@code Map} to validate that additions * match a specified predicate. *

        * This map exists to provide validation for the decorated map. @@ -153,7 +153,7 @@ public class PredicatedMap } /** - * Override to validate an object set into the map via setValue. + * Override to validate an object set into the map via {@code setValue}. * * @param value the value to validate * @return the value itself diff --git a/src/main/java/org/apache/commons/collections4/map/PredicatedSortedMap.java b/src/main/java/org/apache/commons/collections4/map/PredicatedSortedMap.java index 35d6805a1..94da315a2 100644 --- a/src/main/java/org/apache/commons/collections4/map/PredicatedSortedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/PredicatedSortedMap.java @@ -22,7 +22,7 @@ import java.util.SortedMap; import org.apache.commons.collections4.Predicate; /** - * Decorates another SortedMap to validate that additions + * Decorates another {@code SortedMap} to validate that additions * match a specified predicate. *

        * This map exists to provide validation for the decorated map. diff --git a/src/main/java/org/apache/commons/collections4/map/ReferenceIdentityMap.java b/src/main/java/org/apache/commons/collections4/map/ReferenceIdentityMap.java index 63af71370..a75a8a2f2 100644 --- a/src/main/java/org/apache/commons/collections4/map/ReferenceIdentityMap.java +++ b/src/main/java/org/apache/commons/collections4/map/ReferenceIdentityMap.java @@ -23,11 +23,11 @@ import java.io.Serializable; import java.lang.ref.Reference; /** - * A Map implementation that allows mappings to be + * A {@code Map} implementation that allows mappings to be * removed by the garbage collector and matches keys and values based - * on == not equals(). + * on {@code ==} not {@code equals()}. *

        - * When you construct a ReferenceIdentityMap, you can specify what kind + * When you construct a {@code ReferenceIdentityMap}, you can specify what kind * of references are used to store the map's keys and values. * If non-hard references are used, then the garbage collector can remove * mappings if a key or value becomes unreachable, or if the JVM's memory is @@ -42,7 +42,7 @@ import java.lang.ref.Reference; *

        * This map is similar to * {@link org.apache.commons.collections4.map.ReferenceMap ReferenceMap}. - * It differs in that keys and values in this class are compared using ==. + * It differs in that keys and values in this class are compared using {@code ==}. *

        *

        * This map will violate the detail of various Map and map view contracts. @@ -50,17 +50,17 @@ import java.lang.ref.Reference; *

        *

        * This {@link java.util.Map Map} implementation does not allow null elements. - * Attempting to add a null key or value to the map will raise a NullPointerException. + * Attempting to add a null key or value to the map will raise a {@code NullPointerException}. *

        *

        * This implementation is not synchronized. * You can use {@link java.util.Collections#synchronizedMap} to - * provide synchronized access to a ReferenceIdentityMap. + * provide synchronized access to a {@code ReferenceIdentityMap}. * Remember that synchronization will not stop the garbage collector removing entries. *

        *

        * All the available iterators can be reset back to the start by casting to - * ResettableIterator and calling reset(). + * {@code ResettableIterator} and calling {@code reset()}. *

        *

        * Note that ReferenceIdentityMap is not synchronized and is not thread-safe. @@ -82,7 +82,7 @@ public class ReferenceIdentityMap extends AbstractReferenceMap imple private static final long serialVersionUID = -1266190134568365852L; /** - * Constructs a new ReferenceIdentityMap that will + * Constructs a new {@code ReferenceIdentityMap} that will * use hard references to keys and soft references to values. */ public ReferenceIdentityMap() { @@ -91,7 +91,7 @@ public class ReferenceIdentityMap extends AbstractReferenceMap imple } /** - * Constructs a new ReferenceIdentityMap that will + * Constructs a new {@code ReferenceIdentityMap} that will * use the specified types of references. * * @param keyType the type of reference to use for keys; @@ -108,7 +108,7 @@ public class ReferenceIdentityMap extends AbstractReferenceMap imple } /** - * Constructs a new ReferenceIdentityMap that will + * Constructs a new {@code ReferenceIdentityMap} that will * use the specified types of references. * * @param keyType the type of reference to use for keys; @@ -128,7 +128,7 @@ public class ReferenceIdentityMap extends AbstractReferenceMap imple } /** - * Constructs a new ReferenceIdentityMap with the + * Constructs a new {@code ReferenceIdentityMap} with the * specified reference types, load factor and initial capacity. * * @param keyType the type of reference to use for keys; @@ -148,7 +148,7 @@ public class ReferenceIdentityMap extends AbstractReferenceMap imple } /** - * Constructs a new ReferenceIdentityMap with the + * Constructs a new {@code ReferenceIdentityMap} with the * specified reference types, load factor and initial capacity. * * @param keyType the type of reference to use for keys; @@ -202,10 +202,10 @@ public class ReferenceIdentityMap extends AbstractReferenceMap imple * Compares two keys for equals. *

        * This implementation converts the key from the entry to a real reference - * before comparison and uses ==. + * before comparison and uses {@code ==}. * * @param key1 the first key to compare passed in from outside - * @param key2 the second key extracted from the entry via entry.key + * @param key2 the second key extracted from the entry via {@code entry.key} * @return true if equal by identity */ @Override @@ -217,10 +217,10 @@ public class ReferenceIdentityMap extends AbstractReferenceMap imple /** * Compares two values for equals. *

        - * This implementation uses ==. + * This implementation uses {@code ==}. * * @param value1 the first value to compare passed in from outside - * @param value2 the second value extracted from the entry via getValue() + * @param value2 the second value extracted from the entry via {@code getValue()} * @return true if equal by identity */ @Override diff --git a/src/main/java/org/apache/commons/collections4/map/ReferenceMap.java b/src/main/java/org/apache/commons/collections4/map/ReferenceMap.java index 398db24cf..e19df746f 100644 --- a/src/main/java/org/apache/commons/collections4/map/ReferenceMap.java +++ b/src/main/java/org/apache/commons/collections4/map/ReferenceMap.java @@ -22,10 +22,10 @@ import java.io.ObjectOutputStream; import java.io.Serializable; /** - * A Map implementation that allows mappings to be + * A {@code Map} implementation that allows mappings to be * removed by the garbage collector. *

        - * When you construct a ReferenceMap, you can specify what kind + * When you construct a {@code ReferenceMap}, you can specify what kind * of references are used to store the map's keys and values. * If non-hard references are used, then the garbage collector can remove * mappings if a key or value becomes unreachable, or if the JVM's memory is @@ -37,28 +37,28 @@ import java.io.Serializable; * The keys can be configured to be weak but the values hard, * in which case this class will behave like a * - * WeakHashMap. However, you can also specify hard keys and + * {@code WeakHashMap}. However, you can also specify hard keys and * weak values, or any other combination. The default constructor uses * hard keys and soft values, providing a memory-sensitive cache. *

        *

        * This map is similar to * {@link org.apache.commons.collections4.map.ReferenceIdentityMap ReferenceIdentityMap}. - * It differs in that keys and values in this class are compared using equals(). + * It differs in that keys and values in this class are compared using {@code equals()}. *

        *

        * This {@link java.util.Map Map} implementation does not allow null elements. - * Attempting to add a null key or value to the map will raise a NullPointerException. + * Attempting to add a null key or value to the map will raise a {@code NullPointerException}. *

        *

        * This implementation is not synchronized. * You can use {@link java.util.Collections#synchronizedMap} to - * provide synchronized access to a ReferenceMap. + * provide synchronized access to a {@code ReferenceMap}. * Remember that synchronization will not stop the garbage collector removing entries. *

        *

        * All the available iterators can be reset back to the start by casting to - * ResettableIterator and calling reset(). + * {@code ResettableIterator} and calling {@code reset()}. *

        *

        * Note that ReferenceMap is not synchronized and is not thread-safe. @@ -68,9 +68,9 @@ import java.io.Serializable; * exceptions when accessed by concurrent threads without synchronization. *

        *

        - * NOTE: As from Commons Collections 3.1 this map extends AbstractReferenceMap + * NOTE: As from Commons Collections 3.1 this map extends {@code AbstractReferenceMap} * (previously it extended AbstractMap). As a result, the implementation is now - * extensible and provides a MapIterator. + * extensible and provides a {@code MapIterator}. *

        * * @param the type of the keys in the map @@ -85,7 +85,7 @@ public class ReferenceMap extends AbstractReferenceMap implements Se private static final long serialVersionUID = 1555089888138299607L; /** - * Constructs a new ReferenceMap that will + * Constructs a new {@code ReferenceMap} that will * use hard references to keys and soft references to values. */ public ReferenceMap() { @@ -94,7 +94,7 @@ public class ReferenceMap extends AbstractReferenceMap implements Se } /** - * Constructs a new ReferenceMap that will + * Constructs a new {@code ReferenceMap} that will * use the specified types of references. * * @param keyType the type of reference to use for keys; @@ -111,7 +111,7 @@ public class ReferenceMap extends AbstractReferenceMap implements Se } /** - * Constructs a new ReferenceMap that will + * Constructs a new {@code ReferenceMap} that will * use the specified types of references. * * @param keyType the type of reference to use for keys; @@ -130,7 +130,7 @@ public class ReferenceMap extends AbstractReferenceMap implements Se } /** - * Constructs a new ReferenceMap with the + * Constructs a new {@code ReferenceMap} with the * specified reference types, load factor and initial * capacity. * @@ -151,7 +151,7 @@ public class ReferenceMap extends AbstractReferenceMap implements Se } /** - * Constructs a new ReferenceMap with the + * Constructs a new {@code ReferenceMap} with the * specified reference types, load factor and initial * capacity. * diff --git a/src/main/java/org/apache/commons/collections4/map/SingletonMap.java b/src/main/java/org/apache/commons/collections4/map/SingletonMap.java index 753df2f15..68d6be32a 100644 --- a/src/main/java/org/apache/commons/collections4/map/SingletonMap.java +++ b/src/main/java/org/apache/commons/collections4/map/SingletonMap.java @@ -34,11 +34,11 @@ import org.apache.commons.collections4.iterators.SingletonIterator; import org.apache.commons.collections4.keyvalue.TiedMapEntry; /** - * A Map implementation that holds a single item and is fixed size. + * A {@code Map} implementation that holds a single item and is fixed size. *

        * The single key/value pair is specified at creation. * The map is fixed size so any action that would change the size is disallowed. - * However, the put or setValue methods can change + * However, the {@code put} or {@code setValue} methods can change * the value associated with the key. *

        *

        @@ -52,8 +52,8 @@ import org.apache.commons.collections4.keyvalue.TiedMapEntry; *

        *
          *
        • normal Map methods and views - *
        • the MapIterator, see {@link #mapIterator()} - *
        • the KeyValue interface (just cast - no object creation) + *
        • the {@code MapIterator}, see {@link #mapIterator()} + *
        • the {@code KeyValue} interface (just cast - no object creation) *
        * * @param the type of the keys in this map @@ -72,7 +72,7 @@ public class SingletonMap private V value; /** - * Constructor that creates a map of null to null. + * Constructor that creates a map of {@code null} to {@code null}. */ public SingletonMap() { super(); @@ -92,7 +92,7 @@ public class SingletonMap } /** - * Constructor specifying the key and value as a KeyValue. + * Constructor specifying the key and value as a {@code KeyValue}. * * @param keyValue the key value pair to use */ @@ -103,7 +103,7 @@ public class SingletonMap } /** - * Constructor specifying the key and value as a MapEntry. + * Constructor specifying the key and value as a {@code MapEntry}. * * @param mapEntry the mapEntry to use */ @@ -315,7 +315,7 @@ public class SingletonMap //----------------------------------------------------------------------- /** * Gets the entrySet view of the map. - * Changes made via setValue affect this map. + * Changes made via {@code setValue} affect this map. * To simply iterate through the entries, use {@link #mapIterator()}. * * @return the entrySet view diff --git a/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java b/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java index cfc819205..ecd0a234c 100644 --- a/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java +++ b/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java @@ -30,7 +30,7 @@ import org.apache.commons.collections4.KeyValue; /** * A StaticBucketMap is an efficient, thread-safe implementation of - * java.util.Map that performs well in in a highly + * {@code java.util.Map} that performs well in in a highly * thread-contentious environment. The map supports very efficient * {@link #get(Object) get}, {@link #put(Object,Object) put}, * {@link #remove(Object) remove} and {@link #containsKey(Object) containsKey} @@ -63,9 +63,9 @@ import org.apache.commons.collections4.KeyValue; * * * then the results are generally random. Those two statement could cancel - * each other out, leaving staticBucketMapInstance essentially - * unchanged, or they could leave some random subset of map in - * staticBucketMapInstance.

        + * each other out, leaving {@code staticBucketMapInstance} essentially + * unchanged, or they could leave some random subset of {@code map} in + * {@code staticBucketMapInstance}.

        * * Also, much like an encyclopedia, the results of {@link #size()} and * {@link #isEmpty()} are out-of-date as soon as they are produced.

        diff --git a/src/main/java/org/apache/commons/collections4/map/TransformedMap.java b/src/main/java/org/apache/commons/collections4/map/TransformedMap.java index e657ae224..c111eaac7 100644 --- a/src/main/java/org/apache/commons/collections4/map/TransformedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/TransformedMap.java @@ -25,7 +25,7 @@ import java.util.Map; import org.apache.commons.collections4.Transformer; /** - * Decorates another Map to transform objects that are added. + * Decorates another {@code Map} to transform objects that are added. *

        * The Map put methods and Map.Entry setValue method are affected by this class. * Thus objects must be removed or searched for using their transformed form. @@ -211,7 +211,7 @@ public class TransformedMap } /** - * Override to transform the value when using setValue. + * Override to transform the value when using {@code setValue}. * * @param value the value to transform * @return the transformed value diff --git a/src/main/java/org/apache/commons/collections4/map/TransformedSortedMap.java b/src/main/java/org/apache/commons/collections4/map/TransformedSortedMap.java index 4a8959f15..5fb067e33 100644 --- a/src/main/java/org/apache/commons/collections4/map/TransformedSortedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/TransformedSortedMap.java @@ -23,7 +23,7 @@ import java.util.SortedMap; import org.apache.commons.collections4.Transformer; /** - * Decorates another SortedMap to transform objects that are added. + * Decorates another {@code SortedMap } to transform objects that are added. *

        * The Map put methods and Map.Entry setValue method are affected by this class. * Thus objects must be removed or searched for using their transformed form. diff --git a/src/main/java/org/apache/commons/collections4/map/UnmodifiableEntrySet.java b/src/main/java/org/apache/commons/collections4/map/UnmodifiableEntrySet.java index a2221bddb..99966a8a7 100644 --- a/src/main/java/org/apache/commons/collections4/map/UnmodifiableEntrySet.java +++ b/src/main/java/org/apache/commons/collections4/map/UnmodifiableEntrySet.java @@ -29,7 +29,7 @@ import org.apache.commons.collections4.keyvalue.AbstractMapEntryDecorator; import org.apache.commons.collections4.set.AbstractSetDecorator; /** - * Decorates a map entry Set to ensure it can't be altered. + * Decorates a map entry {@code Set} to ensure it can't be altered. *

        * Attempts to modify it will result in an UnsupportedOperationException. *

        diff --git a/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java b/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java index 2d29245cd..ef21b8c15 100644 --- a/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java +++ b/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java @@ -33,7 +33,7 @@ import org.apache.commons.collections4.iterators.UnmodifiableMapIterator; import org.apache.commons.collections4.set.UnmodifiableSet; /** - * Decorates another Map to ensure it can't be altered. + * Decorates another {@code Map} to ensure it can't be altered. *

        * This class is Serializable from Commons Collections 3.1. *

        diff --git a/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java b/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java index 6ce6e7669..3c876b064 100644 --- a/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java @@ -32,7 +32,7 @@ import org.apache.commons.collections4.iterators.UnmodifiableOrderedMapIterator; import org.apache.commons.collections4.set.UnmodifiableSet; /** - * Decorates another OrderedMap to ensure it can't be altered. + * Decorates another {@code OrderedMap} to ensure it can't be altered. *

        * This class is Serializable from Commons Collections 3.1. *

        diff --git a/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java b/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java index 158e23ffd..2252d7116 100644 --- a/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java +++ b/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java @@ -31,7 +31,7 @@ import org.apache.commons.collections4.collection.UnmodifiableCollection; import org.apache.commons.collections4.set.UnmodifiableSet; /** - * Decorates another SortedMap to ensure it can't be altered. + * Decorates another {@code SortedMap} to ensure it can't be altered. *

        * This class is Serializable from Commons Collections 3.1. *

        diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java index 9ba272af7..ca7bc2d57 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java @@ -92,10 +92,10 @@ public abstract class AbstractListValuedMap extends AbstractMultiValuedMap /** * Removes all values associated with the specified key. *

        - * A subsequent get(Object) would return an empty list. + * A subsequent {@code get(Object)} would return an empty list. * * @param key the key to remove values from - * @return the List of values removed, will return an empty, + * @return the {@code List} of values removed, will return an empty, * unmodifiable list for no mapping found. */ @Override diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java index 956a47c63..d5414e3be 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java @@ -157,10 +157,10 @@ public abstract class AbstractMultiValuedMap implements MultiValuedMap - * A subsequent get(Object) would return an empty collection. + * A subsequent {@code get(Object)} would return an empty collection. * * @param key the key to remove values from - * @return the Collection of values removed, will return an + * @return the {@code Collection} of values removed, will return an * empty, unmodifiable collection for no mapping found */ @Override @@ -245,7 +245,7 @@ public abstract class AbstractMultiValuedMap implements MultiValuedMap - * Unlike a normal Map the previous value is not replaced. + * Unlike a normal {@code Map} the previous value is not replaced. * Instead the new value is added to the collection stored against the key. * * @param key the key to store against diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapDecorator.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapDecorator.java index f63236b69..929b9af7b 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapDecorator.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapDecorator.java @@ -28,10 +28,10 @@ import org.apache.commons.collections4.MultiSet; import org.apache.commons.collections4.MultiValuedMap; /** - * Decorates another MultiValuedMap to provide additional behaviour. + * Decorates another {@code MultiValuedMap} to provide additional behaviour. *

        - * Each method call made on this MultiValuedMap is forwarded to the - * decorated MultiValuedMap. This class is used as a framework to build + * Each method call made on this {@code MultiValuedMap} is forwarded to the + * decorated {@code MultiValuedMap}. This class is used as a framework to build * to extensions such as synchronized and unmodifiable behaviour. *

        * diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java index a7b6f6dc6..08e431647 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java @@ -75,8 +75,8 @@ public abstract class AbstractSetValuedMap extends AbstractMultiValuedMap< * return an empty set in case the mapping is not present * * @param key the key to retrieve - * @return the Set of values, will return an empty - * Set for no mapping + * @return the {@code Set} of values, will return an empty + * {@code Set} for no mapping */ @Override public Set get(final K key) { @@ -91,10 +91,10 @@ public abstract class AbstractSetValuedMap extends AbstractMultiValuedMap< /** * Removes all values associated with the specified key. *

        - * A subsequent get(Object) would return an empty set. + * A subsequent {@code get(Object)} would return an empty set. * * @param key the key to remove values from - * @return the Set of values removed, will return an empty, + * @return the {@code Set} of values removed, will return an empty, * unmodifiable set for no mapping found. */ @Override diff --git a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java index cdadb3d0b..bc0d1ece6 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java @@ -96,7 +96,7 @@ public class ArrayListValuedHashMap extends AbstractListValuedMap /** * Creates an ArrayListValuedHashMap copying all the mappings of the given map. * - * @param map a MultiValuedMap to copy into this map + * @param map a {@code MultiValuedMap} to copy into this map */ public ArrayListValuedHashMap(final MultiValuedMap map) { this(map.size(), DEFAULT_INITIAL_LIST_CAPACITY); @@ -106,7 +106,7 @@ public class ArrayListValuedHashMap extends AbstractListValuedMap /** * Creates an ArrayListValuedHashMap copying all the mappings of the given map. * - * @param map a Map to copy into this map + * @param map a {@code Map} to copy into this map */ public ArrayListValuedHashMap(final Map map) { this(map.size(), DEFAULT_INITIAL_LIST_CAPACITY); diff --git a/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java index 3e230e3b2..d839b8e89 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java @@ -95,7 +95,7 @@ public class HashSetValuedHashMap extends AbstractSetValuedMap /** * Creates an HashSetValuedHashMap copying all the mappings of the given map. * - * @param map a MultiValuedMap to copy into this map + * @param map a {@code MultiValuedMap} to copy into this map */ public HashSetValuedHashMap(final MultiValuedMap map) { this(map.size(), DEFAULT_INITIAL_SET_CAPACITY); @@ -105,7 +105,7 @@ public class HashSetValuedHashMap extends AbstractSetValuedMap /** * Creates an HashSetValuedHashMap copying all the mappings of the given map. * - * @param map a Map to copy into this map + * @param map a {@code Map} to copy into this map */ public HashSetValuedHashMap(final Map map) { this(map.size(), DEFAULT_INITIAL_SET_CAPACITY); diff --git a/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java index a7723f009..c17c9ccbb 100644 --- a/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java +++ b/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java @@ -26,7 +26,7 @@ import org.apache.commons.collections4.MultiValuedMap; import org.apache.commons.collections4.Transformer; /** - * Decorates another MultiValuedMap to transform objects that are added. + * Decorates another {@code MultiValuedMap} to transform objects that are added. *

        * This class affects the MultiValuedMap put methods. Thus objects must be * removed or searched for using their transformed form. For example, if the diff --git a/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java b/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java index 26097de91..339ad2c76 100644 --- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java +++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java @@ -22,7 +22,7 @@ import org.apache.commons.collections4.MultiSet; import org.apache.commons.collections4.collection.AbstractCollectionDecorator; /** - * Decorates another MultSet to provide additional behaviour. + * Decorates another {@code MultSet} to provide additional behaviour. *

        * Methods are forwarded directly to the decorated multiset. *

        diff --git a/src/main/java/org/apache/commons/collections4/overview.html b/src/main/java/org/apache/commons/collections4/overview.html index 879bbde10..ba9e93251 100644 --- a/src/main/java/org/apache/commons/collections4/overview.html +++ b/src/main/java/org/apache/commons/collections4/overview.html @@ -25,7 +25,7 @@ come in the form of new interfaces, new implementations and utility classes.

        - See also the java.util package for the standard Java collections. + See also the {@code java.util} package for the standard Java collections.

        Main features

        @@ -41,7 +41,7 @@ {@link org.apache.commons.collections.Bag} - A new Collection subinterface that stores each object together + A new {@code Collection} subinterface that stores each object together with the number of occurrences. Methods are provided to get the number of occurrences, and to add and remove a certain number of that object. @@ -51,7 +51,7 @@ {@link org.apache.commons.collections.Buffer} - A new Collection subinterface that allows objects to be removed + A new {@code Collection} subinterface that allows objects to be removed in some well-defined order. Methods enable the next item to be peeked and removed. @@ -60,7 +60,7 @@ {@link org.apache.commons.collections.BidiMap} - A new Map subinterface that allows lookup from key to value and + A new {@code Map} subinterface that allows lookup from key to value and from value to key with equal ease. @@ -69,7 +69,7 @@ {@link org.apache.commons.collections.OrderedMap} - A new Map subinterface that is used when a map has an order, but is + A new {@code Map} subinterface that is used when a map has an order, but is not sorted. Methods enable bidirectional iteration through the map. @@ -78,7 +78,7 @@ {@link org.apache.commons.collections.MapIterator} - A new Iterator subinterface specially designed for maps. This iterator + A new {@code Iterator} subinterface specially designed for maps. This iterator avoids the need for entrySet iteration of a map, and is simpler to use. @@ -87,7 +87,7 @@ {@link org.apache.commons.collections.ResettableIterator} - A new Iterator subinterface that allows the iteration to be reset back + A new {@code Iterator} subinterface that allows the iteration to be reset back to the start. Many iterators in this library have this functionality. diff --git a/src/main/java/org/apache/commons/collections4/sequence/DeleteCommand.java b/src/main/java/org/apache/commons/collections4/sequence/DeleteCommand.java index f8a33e552..9af8cebb5 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/DeleteCommand.java +++ b/src/main/java/org/apache/commons/collections4/sequence/DeleteCommand.java @@ -43,7 +43,7 @@ public class DeleteCommand extends EditCommand { } /** - * Accept a visitor. When a DeleteCommand accepts a visitor, it calls + * Accept a visitor. When a {@code DeleteCommand} accepts a visitor, it calls * its {@link CommandVisitor#visitDeleteCommand visitDeleteCommand} method. * * @param visitor the visitor to be accepted diff --git a/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java b/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java index c06d61cfe..22f63c837 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java +++ b/src/main/java/org/apache/commons/collections4/sequence/EditCommand.java @@ -33,12 +33,12 @@ package org.apache.commons.collections4.sequence; * inserted into the first sequence, {@link DeleteCommand DeleteCommand} which * correspond to an object of the first sequence being removed and * {@link KeepCommand KeepCommand} which correspond to an object of the first - * sequence which equals an object in the second sequence. It is + * sequence which {@code equals} an object in the second sequence. It is * guaranteed that comparison is always performed this way (i.e. the - * equals method of the object from the first sequence is used and + * {@code equals} method of the object from the first sequence is used and * the object passed as an argument comes from the second sequence) ; this can * be important if subclassing is used for some elements in the first sequence - * and the equals method is specialized. + * and the {@code equals} method is specialized. *

        * * @see SequencesComparator diff --git a/src/main/java/org/apache/commons/collections4/sequence/EditScript.java b/src/main/java/org/apache/commons/collections4/sequence/EditScript.java index 3bfbfcd10..3a0f55e41 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/EditScript.java +++ b/src/main/java/org/apache/commons/collections4/sequence/EditScript.java @@ -33,7 +33,7 @@ import java.util.List; * commands} come from the second sequence and that the objects embedded in * either the {@link DeleteCommand delete commands} or {@link KeepCommand keep * commands} come from the first sequence. This can be important if subclassing - * is used for some elements in the first sequence and the equals + * is used for some elements in the first sequence and the {@code equals} * method is specialized. *

        * diff --git a/src/main/java/org/apache/commons/collections4/sequence/InsertCommand.java b/src/main/java/org/apache/commons/collections4/sequence/InsertCommand.java index a5efa3a8b..4afb30bd6 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/InsertCommand.java +++ b/src/main/java/org/apache/commons/collections4/sequence/InsertCommand.java @@ -43,7 +43,7 @@ public class InsertCommand extends EditCommand { } /** - * Accept a visitor. When an InsertCommand accepts a visitor, + * Accept a visitor. When an {@code InsertCommand} accepts a visitor, * it calls its {@link CommandVisitor#visitInsertCommand visitInsertCommand} * method. * diff --git a/src/main/java/org/apache/commons/collections4/sequence/KeepCommand.java b/src/main/java/org/apache/commons/collections4/sequence/KeepCommand.java index cfd09e74a..c259d0e3f 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/KeepCommand.java +++ b/src/main/java/org/apache/commons/collections4/sequence/KeepCommand.java @@ -19,7 +19,7 @@ package org.apache.commons.collections4.sequence; /** * Command representing the keeping of one object present in both sequences. *

        - * When one object of the first sequence equals another objects in + * When one object of the first sequence {@code equals} another objects in * the second sequence at the right place, the {@link EditScript edit script} * transforming the first sequence into the second sequence uses an instance of * this class to represent the keeping of this object. The objects embedded in @@ -45,7 +45,7 @@ public class KeepCommand extends EditCommand { } /** - * Accept a visitor. When a KeepCommand accepts a visitor, it + * Accept a visitor. When a {@code KeepCommand} accepts a visitor, it * calls its {@link CommandVisitor#visitKeepCommand visitKeepCommand} method. * * @param visitor the visitor to be accepted diff --git a/src/main/java/org/apache/commons/collections4/sequence/ReplacementsHandler.java b/src/main/java/org/apache/commons/collections4/sequence/ReplacementsHandler.java index 16c541853..318f1792a 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/ReplacementsHandler.java +++ b/src/main/java/org/apache/commons/collections4/sequence/ReplacementsHandler.java @@ -37,8 +37,8 @@ public interface ReplacementsHandler { * equals (if they exist). This property also holds for the objects after * the two sub-sequences. *

        - * The replacement is defined as replacing the from - * sub-sequence into the to sub-sequence. + * The replacement is defined as replacing the {@code from} + * sub-sequence into the {@code to} sub-sequence. * * @param skipped number of tokens skipped since the last call (i.e. number of * tokens that were in both sequences), this number should be strictly positive diff --git a/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java b/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java index a486b86b0..b03e73578 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java +++ b/src/main/java/org/apache/commons/collections4/sequence/SequencesComparator.java @@ -24,19 +24,19 @@ import org.apache.commons.collections4.functors.DefaultEquator; /** * This class allows to compare two objects sequences. *

        - * The two sequences can hold any object type, as only the equals + * The two sequences can hold any object type, as only the {@code equals} * method is used to compare the elements of the sequences. It is guaranteed - * that the comparisons will always be done as o1.equals(o2) where - * o1 belongs to the first sequence and o2 belongs to + * that the comparisons will always be done as {@code o1.equals(o2)} where + * {@code o1} belongs to the first sequence and {@code o2} belongs to * the second sequence. This can be important if subclassing is used for some - * elements in the first sequence and the equals method is + * elements in the first sequence and the {@code equals} method is * specialized. *

        *

        * Comparison can be seen from two points of view: either as giving the smallest * modification allowing to transform the first sequence into the second one, or * as giving the longest sequence which is a subsequence of both initial - * sequences. The equals method is used to compare objects, so any + * sequences. The {@code equals} method is used to compare objects, so any * object can be put into sequences. Modifications include deleting, inserting * or keeping one object, starting from the beginning of the first sequence. *

        @@ -79,10 +79,10 @@ public class SequencesComparator { * Creates a new instance of SequencesComparator using a {@link DefaultEquator}. *

        * It is guaranteed that the comparisons will always be done as - * o1.equals(o2) where o1 belongs to the first - * sequence and o2 belongs to the second sequence. This can be + * {@code o1.equals(o2)} where {@code o1} belongs to the first + * sequence and {@code o2} belongs to the second sequence. This can be * important if subclassing is used for some elements in the first sequence - * and the equals method is specialized. + * and the {@code equals} method is specialized. * * @param sequence1 first sequence to be compared * @param sequence2 second sequence to be compared @@ -97,8 +97,8 @@ public class SequencesComparator { * Creates a new instance of SequencesComparator with a custom {@link Equator}. *

        * It is guaranteed that the comparisons will always be done as - * Equator.equate(o1, o2) where o1 belongs to the first - * sequence and o2 belongs to the second sequence. + * {@code Equator.equate(o1, o2)} where {@code o1} belongs to the first + * sequence and {@code o2} belongs to the second sequence. * * @param sequence1 first sequence to be compared * @param sequence2 second sequence to be compared @@ -122,7 +122,7 @@ public class SequencesComparator { * embedded in either the {@link DeleteCommand delete commands} or * {@link KeepCommand keep commands} come from the first sequence. This can * be important if subclassing is used for some elements in the first - * sequence and the equals method is specialized. + * sequence and the {@code equals} method is specialized. * * @return the edit script resulting from the comparison of the two * sequences diff --git a/src/main/java/org/apache/commons/collections4/sequence/package-info.java b/src/main/java/org/apache/commons/collections4/sequence/package-info.java index 796298c93..7902f7985 100644 --- a/src/main/java/org/apache/commons/collections4/sequence/package-info.java +++ b/src/main/java/org/apache/commons/collections4/sequence/package-info.java @@ -18,27 +18,27 @@ * This package provides classes to compare two sequences of objects. *

        * The two sequences can hold any object type, as only the - * equals method is used to compare the elements of the + * {@code equals} method is used to compare the elements of the * sequences. It is guaranteed that the comparisons will always be done - * as o1.equals(o2) where o1 belongs to the - * first sequence and o2 belongs to the second + * as {@code o1.equals(o2)} where {@code o1} belongs to the + * first sequence and {@code o2} belongs to the second * sequence. This can be important if subclassing is used for some - * elements in the first sequence and the equals method is + * elements in the first sequence and the {@code equals} method is * specialized. *

        * Comparison can be seen from two points of view: either as giving the * smallest modification allowing to transform the first sequence into * the second one, or as giving the longest sequence which is a - * subsequence of both initial sequences. The equals method + * subsequence of both initial sequences. The {@code equals} method * is used to compare objects, so any object can be put into * sequences. Modifications include deleting, inserting or keeping one * object, starting from the beginning of the first sequence. Like most * algorithms of the same type, objects transpositions are not - * supported. This means that if a sequence (A, B) is - * compared to (B, A), the result will be either the - * sequence of three commands delete A, keep B, - * insert A or the sequence insert B, - * keep A, delete B. + * supported. This means that if a sequence {@code (A, B)} is + * compared to {@code (B, A)}, the result will be either the + * sequence of three commands {@code delete A}, {@code keep B}, + * {@code insert A} or the sequence {@code insert B}, + * {@code keep A}, {@code delete B}. *

        * The package uses a very efficient comparison algorithm designed by * Eugene W. Myers and described in his paper: * Sometimes however, a more synthetic approach is needed. If the user * prefers to see the differences between the two sequences as global - * replacement operations acting on complete subsequences of + * {@code replacement} operations acting on complete subsequences of * the original sequences, he will provide an object implementing the * simple {@link org.apache.commons.collections4.sequence.ReplacementsHandler} interface, * using an instance of the {@link org.apache.commons.collections4.sequence.ReplacementsFinder} diff --git a/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java b/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java index 00d66920e..38c3f098e 100644 --- a/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java +++ b/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java @@ -20,7 +20,7 @@ import java.util.Iterator; import java.util.NavigableSet; /** - * Decorates another NavigableSet to provide additional behaviour. + * Decorates another {@code NavigableSet} to provide additional behaviour. *

        * Methods are forwarded directly to the decorated set. *

        diff --git a/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java b/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java index 86e69d631..a17c9f5b8 100644 --- a/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java +++ b/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java @@ -21,7 +21,7 @@ import java.util.Set; import org.apache.commons.collections4.collection.AbstractCollectionDecorator; /** - * Decorates another Set to provide additional behaviour. + * Decorates another {@code Set} to provide additional behaviour. *

        * Methods are forwarded directly to the decorated set. *

        diff --git a/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java b/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java index 25c8f27f5..d4b26f0bf 100644 --- a/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java +++ b/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java @@ -21,7 +21,7 @@ import java.util.Set; import java.util.SortedSet; /** - * Decorates another SortedSet to provide additional behaviour. + * Decorates another {@code SortedSet} to provide additional behaviour. *

        * Methods are forwarded directly to the decorated set. *

        diff --git a/src/main/java/org/apache/commons/collections4/set/CompositeSet.java b/src/main/java/org/apache/commons/collections4/set/CompositeSet.java index 70168b86c..ebed42272 100644 --- a/src/main/java/org/apache/commons/collections4/set/CompositeSet.java +++ b/src/main/java/org/apache/commons/collections4/set/CompositeSet.java @@ -69,7 +69,7 @@ public class CompositeSet implements Set, Serializable { } /** - * Create a CompositeSet with just set composited. + * Create a CompositeSet with just {@code set} composited. * * @param set the initial set in the composite */ @@ -92,7 +92,7 @@ public class CompositeSet implements Set, Serializable { /** * Gets the size of this composite set. *

        - * This implementation calls size() on each set. + * This implementation calls {@code size()} on each set. * * @return total number of elements in all contained containers */ @@ -108,7 +108,7 @@ public class CompositeSet implements Set, Serializable { /** * Checks whether this composite set is empty. *

        - * This implementation calls isEmpty() on each set. + * This implementation calls {@code isEmpty()} on each set. * * @return true if all of the contained sets are empty */ @@ -125,7 +125,7 @@ public class CompositeSet implements Set, Serializable { /** * Checks whether this composite set contains the object. *

        - * This implementation calls contains() on each set. + * This implementation calls {@code contains()} on each set. * * @param obj the object to search for * @return true if obj is contained in any of the contained sets @@ -143,10 +143,10 @@ public class CompositeSet implements Set, Serializable { /** * Gets an iterator over all the sets in this composite. *

        - * This implementation uses an IteratorChain. + * This implementation uses an {@code IteratorChain}. * - * @return an IteratorChain instance which supports - * remove(). Iteration occurs over contained collections in + * @return an {@code IteratorChain} instance which supports + * {@code remove()}. Iteration occurs over contained collections in * the order they were added, but this behavior should not be relied upon. * @see IteratorChain */ @@ -179,7 +179,7 @@ public class CompositeSet implements Set, Serializable { /** * Returns an object array, populating the supplied array if possible. - * See Collection interface for full details. + * See {@code Collection} interface for full details. * * @param the type of the elements in the collection * @param array the array to use, populating if possible @@ -229,7 +229,7 @@ public class CompositeSet implements Set, Serializable { } /** - * If a CollectionMutator is defined for this CompositeSet then this + * If a {@code CollectionMutator} is defined for this CompositeSet then this * method will be called anyway. * * @param obj object to be removed @@ -248,7 +248,7 @@ public class CompositeSet implements Set, Serializable { /** * Checks whether this composite contains all the elements in the specified collection. *

        - * This implementation calls contains() for each element in the + * This implementation calls {@code contains()} for each element in the * specified collection. * * @param coll the collection to check for @@ -305,7 +305,7 @@ public class CompositeSet implements Set, Serializable { /** * Removes the elements in the specified collection from this composite set. *

        - * This implementation calls removeAll on each collection. + * This implementation calls {@code removeAll} on each collection. * * @param coll the collection to remove * @return true if the composite was modified @@ -327,7 +327,7 @@ public class CompositeSet implements Set, Serializable { * Retains all the elements in the specified collection in this composite set, * removing all others. *

        - * This implementation calls retainAll() on each collection. + * This implementation calls {@code retainAll()} on each collection. * * @param coll the collection to remove * @return true if the composite was modified @@ -345,7 +345,7 @@ public class CompositeSet implements Set, Serializable { /** * Removes all of the elements from this composite set. *

        - * This implementation calls clear() on each set. + * This implementation calls {@code clear()} on each set. * * @throws UnsupportedOperationException if clear is unsupported */ @@ -521,7 +521,7 @@ public class CompositeSet implements Set, Serializable { * Called when a Set is added to the CompositeSet and there is a * collision between existing and added sets. *

        - * If added and existing still have any intersects + * If {@code added} and {@code existing} still have any intersects * after this method returns an IllegalArgumentException will be thrown. * * @param comp the CompositeSet being modified diff --git a/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java b/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java index 828262756..b64f58b25 100644 --- a/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java +++ b/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java @@ -32,7 +32,7 @@ import org.apache.commons.collections4.iterators.AbstractIteratorDecorator; import org.apache.commons.collections4.list.UnmodifiableList; /** - * Decorates another Set to ensure that the order of addition is + * Decorates another {@code Set} to ensure that the order of addition is * retained and used by the iterator. *

        * If an object is added to the set for a second time, it will remain in the @@ -41,12 +41,12 @@ import org.apache.commons.collections4.list.UnmodifiableList; *

        *

        * The ListOrderedSet also has various useful direct methods. These include many - * from List, such as get(int), - * remove(int) and indexOf(int). An unmodifiable - * List view of the set can be obtained via asList(). + * from {@code List}, such as {@code get(int)}, + * {@code remove(int)} and {@code indexOf(int)}. An unmodifiable + * {@code List} view of the set can be obtained via {@code asList()}. *

        *

        - * This class cannot implement the List interface directly as + * This class cannot implement the {@code List} interface directly as * various interface methods (notably equals/hashCode) are incompatible with a * set. *

        @@ -91,7 +91,7 @@ public class ListOrderedSet /** * Factory method to create an ordered set. *

        - * An ArrayList is used to retain order. + * An {@code ArrayList} is used to retain order. * * @param the element type * @param set the set to decorate, must not be null @@ -106,7 +106,7 @@ public class ListOrderedSet /** * Factory method to create an ordered set using the supplied list to retain order. *

        - * A HashSet is used for the set behaviour. + * A {@code HashSet} is used for the set behaviour. *

        * NOTE: If the list contains duplicates, the duplicates are removed, * altering the specified list. @@ -127,8 +127,8 @@ public class ListOrderedSet // ----------------------------------------------------------------------- /** - * Constructs a new empty ListOrderedSet using a - * HashSet and an ArrayList internally. + * Constructs a new empty {@code ListOrderedSet} using a + * {@code HashSet} and an {@code ArrayList} internally. * * @since 3.1 */ @@ -240,9 +240,9 @@ public class ListOrderedSet * {@inheritDoc} *

        * This implementation iterates over the elements of this set, checking - * each element in turn to see if it's contained in coll. + * each element in turn to see if it's contained in {@code coll}. * If it's not contained, it's removed from this set. As a consequence, - * it is advised to use a collection type for coll that provides + * it is advised to use a collection type for {@code coll} that provides * a fast (e.g. O(1)) implementation of {@link Collection#contains(Object)}. */ @Override diff --git a/src/main/java/org/apache/commons/collections4/set/MapBackedSet.java b/src/main/java/org/apache/commons/collections4/set/MapBackedSet.java index a15c34118..748df14be 100644 --- a/src/main/java/org/apache/commons/collections4/set/MapBackedSet.java +++ b/src/main/java/org/apache/commons/collections4/set/MapBackedSet.java @@ -25,15 +25,15 @@ import java.util.Set; import java.util.function.Predicate; /** - * Decorates a Map to obtain Set behaviour. + * Decorates a {@code Map} to obtain {@code Set} behaviour. *

        - * This class is used to create a Set with the same properties as + * This class is used to create a {@code Set} with the same properties as * the key set of any map. Thus, a ReferenceSet can be created by wrapping a - * ReferenceMap in an instance of this class. + * {@code ReferenceMap} in an instance of this class. *

        *

        * Most map implementation can be used to create a set by passing in dummy values. - * Exceptions include BidiMap implementations, as they require unique values. + * Exceptions include {@code BidiMap} implementations, as they require unique values. *

        * * @param the type of the elements in this set diff --git a/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java b/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java index 23ca5964f..64fb88fb1 100644 --- a/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java +++ b/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java @@ -22,7 +22,7 @@ import java.util.NavigableSet; import org.apache.commons.collections4.Predicate; /** - * Decorates another NavigableSet to validate that all additions + * Decorates another {@code NavigableSet} to validate that all additions * match a specified predicate. *

        * This set exists to provide validation for the decorated set. diff --git a/src/main/java/org/apache/commons/collections4/set/PredicatedSet.java b/src/main/java/org/apache/commons/collections4/set/PredicatedSet.java index d63f0c250..f437bbca4 100644 --- a/src/main/java/org/apache/commons/collections4/set/PredicatedSet.java +++ b/src/main/java/org/apache/commons/collections4/set/PredicatedSet.java @@ -22,7 +22,7 @@ import org.apache.commons.collections4.Predicate; import org.apache.commons.collections4.collection.PredicatedCollection; /** - * Decorates another Set to validate that all additions + * Decorates another {@code Set} to validate that all additions * match a specified predicate. *

        * This set exists to provide validation for the decorated set. diff --git a/src/main/java/org/apache/commons/collections4/set/PredicatedSortedSet.java b/src/main/java/org/apache/commons/collections4/set/PredicatedSortedSet.java index 0459efcb2..5d37bf1d9 100644 --- a/src/main/java/org/apache/commons/collections4/set/PredicatedSortedSet.java +++ b/src/main/java/org/apache/commons/collections4/set/PredicatedSortedSet.java @@ -22,7 +22,7 @@ import java.util.SortedSet; import org.apache.commons.collections4.Predicate; /** - * Decorates another SortedSet to validate that all additions + * Decorates another {@code SortedSet} to validate that all additions * match a specified predicate. *

        * This set exists to provide validation for the decorated set. diff --git a/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java b/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java index 69631809c..7e2cc26ac 100644 --- a/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java +++ b/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java @@ -22,7 +22,7 @@ import java.util.NavigableSet; import org.apache.commons.collections4.Transformer; /** - * Decorates another NavigableSet to transform objects that are added. + * Decorates another {@code NavigableSet} to transform objects that are added. *

        * The add methods are affected by this class. * Thus objects must be removed or searched for using their transformed form. diff --git a/src/main/java/org/apache/commons/collections4/set/TransformedSet.java b/src/main/java/org/apache/commons/collections4/set/TransformedSet.java index 9e6cf57d2..85f1d92af 100644 --- a/src/main/java/org/apache/commons/collections4/set/TransformedSet.java +++ b/src/main/java/org/apache/commons/collections4/set/TransformedSet.java @@ -22,7 +22,7 @@ import org.apache.commons.collections4.Transformer; import org.apache.commons.collections4.collection.TransformedCollection; /** - * Decorates another Set to transform objects that are added. + * Decorates another {@code Set} to transform objects that are added. *

        * The add methods are affected by this class. * Thus objects must be removed or searched for using their transformed form. diff --git a/src/main/java/org/apache/commons/collections4/set/TransformedSortedSet.java b/src/main/java/org/apache/commons/collections4/set/TransformedSortedSet.java index 6946a8300..569854b09 100644 --- a/src/main/java/org/apache/commons/collections4/set/TransformedSortedSet.java +++ b/src/main/java/org/apache/commons/collections4/set/TransformedSortedSet.java @@ -22,7 +22,7 @@ import java.util.SortedSet; import org.apache.commons.collections4.Transformer; /** - * Decorates another SortedSet to transform objects that are added. + * Decorates another {@code SortedSet} to transform objects that are added. *

        * The add methods are affected by this class. * Thus objects must be removed or searched for using their transformed form. diff --git a/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java b/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java index e13507d02..1441f2606 100644 --- a/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java +++ b/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java @@ -29,7 +29,7 @@ import org.apache.commons.collections4.Unmodifiable; import org.apache.commons.collections4.iterators.UnmodifiableIterator; /** - * Decorates another NavigableSet to ensure it can't be altered. + * Decorates another {@code NavigableSet} to ensure it can't be altered. *

        * Attempts to modify it will result in an UnsupportedOperationException. *

        diff --git a/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java b/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java index 6d8d43f15..1a04b5f5a 100644 --- a/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java +++ b/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java @@ -25,7 +25,7 @@ import org.apache.commons.collections4.Unmodifiable; import org.apache.commons.collections4.iterators.UnmodifiableIterator; /** - * Decorates another Set to ensure it can't be altered. + * Decorates another {@code Set} to ensure it can't be altered. *

        * This class is Serializable from Commons Collections 3.1. *

        diff --git a/src/main/java/org/apache/commons/collections4/set/UnmodifiableSortedSet.java b/src/main/java/org/apache/commons/collections4/set/UnmodifiableSortedSet.java index 50c7f7de8..daf310782 100644 --- a/src/main/java/org/apache/commons/collections4/set/UnmodifiableSortedSet.java +++ b/src/main/java/org/apache/commons/collections4/set/UnmodifiableSortedSet.java @@ -28,7 +28,7 @@ import org.apache.commons.collections4.Unmodifiable; import org.apache.commons.collections4.iterators.UnmodifiableIterator; /** - * Decorates another SortedSet to ensure it can't be altered. + * Decorates another {@code SortedSet} to ensure it can't be altered. *

        * This class is Serializable from Commons Collections 3.1. *

        diff --git a/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java b/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java index 8ba62401a..bf162821a 100644 --- a/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java +++ b/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java @@ -48,7 +48,7 @@ import org.apache.commons.collections4.map.LinkedMap; * contrast with {@link org.apache.commons.collections4.map.TransformedMap} which, * by virtue of its implementing {@link Map}<K, V>, must be constructed in such * a way that its read and write parameters are generalized to a common (super-)type. - * In practice this would often mean >Object, Object>, defeating + * In practice this would often mean {@code >Object, Object>}, defeating * much of the usefulness of having parameterized types. *

        *

        @@ -191,7 +191,7 @@ public class TransformedSplitMap extends AbstractIterableGetMapDecor } /** - * Override to transform the value when using setValue. + * Override to transform the value when using {@code setValue}. * * @param value the value to transform * @return the transformed value