Skip to content

Commit

Permalink
Javadoc: English, not Latin
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 31, 2024
1 parent baf26fa commit b4346ec
Show file tree
Hide file tree
Showing 22 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public int hashCode() {
}

/**
* Helper class for set-related operations, e.g. union, subtract, intersection.
* Helper class for set-related operations, for example union, subtract, intersection.
* @param <O> the element type
*/
private static final class SetOperationCardinalityHelper<O> extends CardinalityHelper<O> implements Iterable<O> {
Expand Down Expand Up @@ -1216,7 +1216,7 @@ public static boolean isEqualCollection(final Collection<?> a, final Collection<
* <p>
* <strong>Note:</strong> from version 4.1 onwards this method requires the input
* collections and equator to be of compatible type (using bounded wildcards).
* Providing incompatible arguments (e.g. by casting to their rawtypes)
* Providing incompatible arguments (for example by casting to their rawtypes)
* will result in a {@code ClassCastException} thrown at runtime.
* </p>
*
Expand Down Expand Up @@ -1404,7 +1404,7 @@ public static int maxSize(final Collection<? extends Object> collection) {
* <p>
* NOTE: the number of permutations of a given collection is equal to n!, where
* n is the size of the collection. Thus, the resulting collection will become
* <strong>very</strong> large for collections &gt; 10 (e.g. 10! = 3628800, 15! = 1307674368000).
* <strong>very</strong> large for collections &gt; 10 (for example 10! = 3628800, 15! = 1307674368000).
* </p>
* <p>
* For larger collections it is advised to use a {@link PermutationIterator} to
Expand Down Expand Up @@ -1462,7 +1462,7 @@ public static <C> Collection<C> predicatedCollection(final Collection<C> collect
* 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
* {@code remove} that provides a fast (e.g. O(1)) implementation of
* {@code remove} that provides a fast (for example O(1)) implementation of
* {@link Collection#contains(Object)}.
* </p>
*
Expand Down Expand Up @@ -1600,7 +1600,7 @@ public static <E> Collection<E> removeRange(final Collection<E> input, final int
* 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
* {@code retain} that provides a fast (e.g. O(1)) implementation of
* {@code retain} that provides a fast (for example O(1)) implementation of
* {@link Collection#contains(Object)}.
* </p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
* </p>
* <ul>
* <li>fluent methods which return a new {@code FluentIterable} instance,
* providing a view of the original iterable (e.g. filter(Predicate));
* providing a view of the original iterable (for example filter(Predicate));
* <li>conversion methods which copy the FluentIterable's contents into a
* new collection or array (e.g. toList());
* new collection or array (for example toList());
* <li>utility methods which answer questions about the FluentIterable's
* contents (e.g. size(), anyMatch(Predicate)).
* contents (for example size(), anyMatch(Predicate)).
* <li>
* </ul>
* <p>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/apache/commons/collections4/ListUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public static <E> List<E> predicatedList(final List<E> list, final Predicate<E>
* 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
* {@code remove} that provides a fast (e.g. O(1)) implementation of
* {@code remove} that provides a fast (for example O(1)) implementation of
* {@link Collection#contains(Object)}.
* </p>
*
Expand Down Expand Up @@ -571,7 +571,7 @@ public static <E> List<E> removeAll(final Collection<E> collection, final Collec
* 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
* {@code retain} that provides a fast (e.g. O(1)) implementation of
* {@code retain} that provides a fast (for example O(1)) implementation of
* {@link Collection#contains(Object)}.
* </p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ public static void verbosePrint(final PrintStream out, final Object label, final
* given map with nice line breaks. If the debug flag is true, it additionally prints the type of the object value.
* If the contents of a map include the map itself, then the text <em>(this Map)</em> is printed out. If the
* contents include a parent container of the map, the text <em>(ancestor[i] Map)</em> is printed, where it actually
* indicates the number of levels which must be traversed in the sequential list of ancestors (e.g. father,
* indicates the number of levels which must be traversed in the sequential list of ancestors (for example father,
* grandfather, great-grandfather, etc.).
*
* @param out the stream to print to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ public interface MultiValuedMap<K, V> {
* @param value the value to add to the collection at the key
* @return true if the map changed as a result of this put operation, or false
* if the map already contained the key-value mapping and the collection
* type does not allow duplicate values, e.g. when using a Set
* type does not allow duplicate values, for example when using a Set
* @throws UnsupportedOperationException if the put operation is not supported by
* this multivalued map, e.g. if it is unmodifiable
* this multivalued map, for example if it is unmodifiable
* @throws NullPointerException if the key or value is null and null is invalid (optional)
* @throws IllegalArgumentException if some aspect of the specified key or value prevents
* it from being stored in this multivalued map
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public boolean removeAll(final Collection<?> 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 {@code coll} that provides
* a fast (e.g. O(1)) implementation of {@link Collection#contains(Object)}.
* a fast (for example O(1)) implementation of {@link Collection#contains(Object)}.
* </p>
*
* @param coll the collection to retain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void remove() {
if (!canRemove) {
throw new IllegalStateException("Iterator remove() can only be called once after next()");
}
// store value as remove may change the entry in the decorator (e.g. TreeMap)
// store value as remove may change the entry in the decorator (for example TreeMap)
final V value = last.getValue();
iterator.remove();
parent.reverseMap.remove(value);
Expand Down Expand Up @@ -230,7 +230,7 @@ public void remove() {
if (!canRemove) {
throw new IllegalStateException("Iterator remove() can only be called once after next()");
}
// store value as remove may change the entry in the decorator (e.g. TreeMap)
// store value as remove may change the entry in the decorator (for example TreeMap)
final Object value = last.getValue();
super.remove();
parent.reverseMap.remove(value);
Expand Down Expand Up @@ -527,7 +527,7 @@ public boolean removeIf(final Predicate<? super E> filter) {
* This implementation iterates over the elements of this bidi map, checking each element in
* 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
* {@code coll} that provides a fast (e.g. O(1)) implementation of
* {@code coll} that provides a fast (for example O(1)) implementation of
* {@link Collection#contains(Object)}.
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* </p>
* <p>
* While that goal could be accomplished by taking a pair of TreeMaps
* and redirecting requests to the appropriate TreeMap (e.g.,
* and redirecting requests to the appropriate TreeMap (for example,
* containsKey would be directed to the TreeMap that maps values to
* keys, containsValue would be directed to the TreeMap that maps keys
* to values), there are problems with that implementation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static <T extends BloomFilter<T>> Consumer<Deque<T>> onMaxSize(final int

/**
* Removes the last added target if it is empty. Useful as the first in a chain
* of cleanup consumers. (e.g. {@code Cleanup.removeEmptyTarget.andThen( otherConsumer )})
* of cleanup consumers. (for example {@code Cleanup.removeEmptyTarget.andThen( otherConsumer )})
*
* @param <T> Type of BloomFilter.
* @return A Consumer suitable for the LayerManager {@code cleanup} parameter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* list. There are lots of other uses, and in most cases the reason is to perform a fast check as a gateway for a longer
* operation.</p>
*
* <p>Some Bloom filters (e.g. {@link org.apache.commons.collections4.bloomfilter.CountingBloomFilter}) use counters rather than bits. In this case each counter
* <p>Some Bloom filters (for example {@link org.apache.commons.collections4.bloomfilter.CountingBloomFilter}) use counters rather than bits. In this case each counter
* is called a <em>cell</em>.</p>
*
* <h3>BloomFilter</h3>
Expand All @@ -51,7 +51,7 @@
* <li><em>index</em> - In the {@code bloomfilter} package an Index is a logical collection of {@code int}s specifying the enabled
* bits in the bit map.</li>
*
* <li><em>cell</em> - Some Bloom filters (e.g. {@link org.apache.commons.collections4.bloomfilter.CountingBloomFilter}) use counters rather than bits. In the {@code bloomfilter} package
* <li><em>cell</em> - Some Bloom filters (for example {@link org.apache.commons.collections4.bloomfilter.CountingBloomFilter}) use counters rather than bits. In the {@code bloomfilter} package
* Cells are pairs of ints representing an index and a value. They are not the standard Java {@code Pair} objects,
* nor the Apache Commons Lang version either.</li>
*
Expand All @@ -61,7 +61,7 @@
* {@link org.apache.commons.collections4.bloomfilter.IndexExtractor} and have a {@code processXs} methods that take a
* type specialization of {@link java.util.function.Predicate}.
* {@code Predicate} type argument.
* (e.g. {@link org.apache.commons.collections4.bloomfilter.BitMapExtractor#processBitMaps(java.util.function.LongPredicate)},
* (for example {@link org.apache.commons.collections4.bloomfilter.BitMapExtractor#processBitMaps(java.util.function.LongPredicate)},
* {@link org.apache.commons.collections4.bloomfilter.IndexExtractor#processIndices(java.util.function.IntPredicate)},
* and {@link org.apache.commons.collections4.bloomfilter.CellExtractor#processCells(org.apache.commons.collections4.bloomfilter.CellExtractor.CellPredicate)}).
* The predicate is expected to process each of the Xs in turn and return {@code true} if the processing should continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.collections4.Predicate;

/**
* Abstract base class for quantification predicates, e.g. All, Any, None.
* Abstract base class for quantification predicates, for example All, Any, None.
*
* @param <T> the type of the input to the predicate.
* @since 4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.apache.commons.collections4.IteratorUtils;

/**
* Extends Iterator functionality to include operations commonly found on streams (e.g. filtering, concatenating, mapping). It also provides convenience methods
* Extends Iterator functionality to include operations commonly found on streams (for example filtering, concatenating, mapping). It also provides convenience methods
* for common operations.
*
* @param <T> The type of object returned from the iterator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ public boolean remove(final Object value) {
* This implementation iterates over the elements of this list, checking each element in
* 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
* {@code coll} that provides a fast (e.g. O(1)) implementation of
* {@code coll} that provides a fast (for example O(1)) implementation of
* {@link Collection#contains(Object)}.
*/
@Override
Expand Down Expand Up @@ -1039,7 +1039,7 @@ protected void removeNode(final Node<E> node) {
* This implementation iterates over the elements of this list, checking 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
* {@code coll} that provides a fast (e.g. O(1)) implementation of
* {@code coll} that provides a fast (for example O(1)) implementation of
* {@link Collection#contains(Object)}.
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ public boolean remove(final Object value) {
* This implementation iterates over the elements of this list, checking each element in
* 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
* {@code coll} that provides a fast (e.g. O(1)) implementation of
* {@code coll} that provides a fast (for example O(1)) implementation of
* {@link Collection#contains(Object)}.
*/
@Override
Expand Down Expand Up @@ -1022,7 +1022,7 @@ protected void removeNode(final Node<E> node) {
* This implementation iterates over the elements of this list, checking 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
* {@code coll} that provides a fast (e.g. O(1)) implementation of
* {@code coll} that provides a fast (for example O(1)) implementation of
* {@link Collection#contains(Object)}.
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ public boolean removeIf(final Predicate<? super E> filter) {
* 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 {@code coll} that provides
* a fast (e.g. O(1)) implementation of {@link Collection#contains(Object)}.
* a fast (for example O(1)) implementation of {@link Collection#contains(Object)}.
*/
@Override
public boolean retainAll(final Collection<?> coll) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* <p>
* This implementation does not forward the hashCode and equals methods through
* to the backing object, but relies on Object's implementation. This is
* necessary as some Queue implementations, e.g. LinkedList, have a custom
* necessary as some Queue implementations, for example LinkedList, have a custom
* equals implementation for which symmetry cannot be preserved.
* See class Javadoc of AbstractCollectionDecorator for more information.
* </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public boolean removeIf(final Predicate<? super E> filter) {
* 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 {@code coll} that provides
* a fast (e.g. O(1)) implementation of {@link Collection#contains(Object)}.
* a fast (for example O(1)) implementation of {@link Collection#contains(Object)}.
*/
@Override
public boolean retainAll(final Collection<?> coll) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ protected boolean skipSerializedCanonicalTests() {
/**
* Override this method if a subclass is testing an object
* that cannot serialize an "empty" Collection.
* (e.g. Comparators have no contents)
* (for example Comparators have no contents)
*
* @return true
*/
Expand All @@ -183,7 +183,7 @@ public boolean supportsEmptyCollections() {
/**
* Override this method if a subclass is testing an object
* that cannot serialize a "full" Collection.
* (e.g. Comparators have no contents)
* (for example Comparators have no contents)
*
* @return true
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void cardinality() {

// Ensure that generic bounds accept valid parameters, but return
// expected results
// e.g. no longs in the "int" Iterable<Number>, and vice versa.
// for example no longs in the "int" Iterable<Number>, and vice versa.
assertEquals(0, CollectionUtils.cardinality(2L, iterableA2));
assertEquals(0, CollectionUtils.cardinality(2, iterableB2));

Expand Down Expand Up @@ -1048,7 +1048,7 @@ public void testGetFromLinkedHashMap() {
}

/**
* Tests that {@link List}s are handled correctly - e.g. using
* Tests that {@link List}s are handled correctly - for example using
* {@link List#get(int)}.
*/
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public void testFrequency() {

// Ensure that generic bounds accept valid parameters, but return
// expected results
// e.g. no longs in the "int" Iterable<Number>, and vice versa.
// for example no longs in the "int" Iterable<Number>, and vice versa.
final Iterable<Number> iterableIntAsNumber = Arrays.<Number>asList(1, 2, 3, 4, 5);
final Iterable<Number> iterableLongAsNumber = Arrays.<Number>asList(1L, 2L, 3L, 4L, 5L);
assertEquals(0, IterableUtils.frequency(iterableIntAsNumber, 2L));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ int[] toArray() {
private static final IntPredicate TRUE_PREDICATE = i -> true;

private static final IntPredicate FALSE_PREDICATE = i -> false;
/** Flag to indicate the indices are ordered, e.g. from {@link IndexExtractor#processIndices(IntPredicate)}. */
/** Flag to indicate the indices are ordered, for example from {@link IndexExtractor#processIndices(IntPredicate)}. */
protected static final int ORDERED = 0x1;

/** Flag to indicate the indices are distinct, e.g. from {@link IndexExtractor#processIndices(IntPredicate)}. */
/** Flag to indicate the indices are distinct, for example from {@link IndexExtractor#processIndices(IntPredicate)}. */
protected static final int DISTINCT = 0x2;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2538,7 +2538,7 @@ public void verifyMap() {
assertEquals(empty, getMap().isEmpty(), "Map should be empty if HashMap is");
assertEquals(getConfirmed().hashCode(), getMap().hashCode(), "hashCodes should be the same");
// changing the order of the assertion below fails for LRUMap because confirmed is
// another collection (e.g. treemap) and confirmed.equals() creates a normal iterator (not
// another collection (for example treemap) and confirmed.equals() creates a normal iterator (not
// #mapIterator()), which modifies the parent expected modCount of the map object, causing
// concurrent modification exceptions.
// Because of this we have assertEquals(map, confirmed), and not the other way around.
Expand Down

0 comments on commit b4346ec

Please sign in to comment.