Fix checkstyle warnings.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1682211 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2015-05-28 11:16:44 +00:00
parent b1e21c8a6e
commit ba72be98b6
4 changed files with 26 additions and 27 deletions

View File

@ -36,7 +36,7 @@ import java.util.List;
* new collection or array (e.g. toList()); * new collection or array (e.g. toList());
* <li>utility methods which answer questions about the FluentIterable's * <li>utility methods which answer questions about the FluentIterable's
* contents (e.g. size(), anyMatch(Predicate)). * contents (e.g. size(), anyMatch(Predicate)).
* <li> * <li>
* </ul> * </ul>
* <p> * <p>
* The following example outputs the first 3 even numbers in the range [1, 10] * The following example outputs the first 3 even numbers in the range [1, 10]
@ -279,6 +279,7 @@ public class FluentIterable<E> implements Iterable<E> {
* Returns a new FluentIterable whose iterator will return all elements * Returns a new FluentIterable whose iterator will return all elements
* of this iterable transformed by the provided transformer. * of this iterable transformed by the provided transformer.
* *
* @param <O> the output element type
* @param transformer the transformer applied to each element * @param transformer the transformer applied to each element
* @return a new iterable, providing a transformed view of this iterable * @return a new iterable, providing a transformed view of this iterable
* @throws NullPointerException if transformer is null * @throws NullPointerException if transformer is null
@ -315,7 +316,7 @@ public class FluentIterable<E> implements Iterable<E> {
* the elements of this iterable and the other iterable in * the elements of this iterable and the other iterable in
* alternating order. * alternating order.
* *
* @param other the other iterable to interleave * @param others the iterables to interleave
* @return a new iterable, interleaving this iterable with others * @return a new iterable, interleaving this iterable with others
*/ */
public FluentIterable<E> zip(final Iterable<E>... others) { public FluentIterable<E> zip(final Iterable<E>... others) {
@ -394,7 +395,7 @@ public class FluentIterable<E> implements Iterable<E> {
/** /**
* Checks if the object is contained in this iterable. * Checks if the object is contained in this iterable.
* *
* @param object the object to check * @param object the object to check
* @return true if the object is contained in this iterable, false otherwise * @return true if the object is contained in this iterable, false otherwise
*/ */
@ -447,7 +448,7 @@ public class FluentIterable<E> implements Iterable<E> {
* Returns an array containing all elements of this iterable by traversing * Returns an array containing all elements of this iterable by traversing
* its iterator. * its iterator.
* *
* @param arrayClass the class of array to create * @param arrayClass the class of array to create
* @return an array of the iterable contents * @return an array of the iterable contents
* @throws ClassCastException if arrayClass is invalid * @throws ClassCastException if arrayClass is invalid
*/ */

View File

@ -124,7 +124,6 @@ public class IterableUtils {
@Override @Override
public Iterator<E> iterator() { public Iterator<E> iterator() {
return new LazyIteratorChain<E>() { return new LazyIteratorChain<E>() {
@Override @Override
protected Iterator<? extends E> nextIterator(int count) { protected Iterator<? extends E> nextIterator(int count) {
if (count > iterables.length) { if (count > iterables.length) {
@ -133,7 +132,6 @@ public class IterableUtils {
return emptyIteratorIfNull(iterables[count - 1]); return emptyIteratorIfNull(iterables[count - 1]);
} }
} }
}; };
} }
}; };
@ -224,7 +222,7 @@ public class IterableUtils {
@Override @Override
public Iterator<E> iterator() { public Iterator<E> iterator() {
return IteratorUtils.boundedIterator(emptyIteratorIfNull(iterable), maxSize); return IteratorUtils.boundedIterator(emptyIteratorIfNull(iterable), maxSize);
} }
}; };
} }
@ -273,10 +271,9 @@ public class IterableUtils {
/** /**
* Returns a reversed view of the given iterable. * Returns a reversed view of the given iterable.
* <p> * <p>
* In case the provided iterable is a {@link List} instance, a * In case the provided iterable is a {@link List} instance, a
* {@link ReverseListIterator} will be used to reverse the traversal * {@link ReverseListIterator} will be used to reverse the traversal
* order, otherwise an intermediate {@link List} needs to be * order, otherwise an intermediate {@link List} needs to be created.
* created.
* <p> * <p>
* The returned iterable's iterator supports {@code remove()} if the * The returned iterable's iterator supports {@code remove()} if the
* provided iterable is a {@link List} instance. * provided iterable is a {@link List} instance.
@ -323,7 +320,7 @@ public class IterableUtils {
@Override @Override
public Iterator<E> iterator() { public Iterator<E> iterator() {
return IteratorUtils.skippingIterator(emptyIteratorIfNull(iterable), elementsToSkip); return IteratorUtils.skippingIterator(emptyIteratorIfNull(iterable), elementsToSkip);
} }
}; };
} }
@ -337,7 +334,8 @@ public class IterableUtils {
* The returned iterable's iterator supports {@code remove()} when the corresponding * The returned iterable's iterator supports {@code remove()} when the corresponding
* input iterator supports it. * input iterator supports it.
* *
* @param <E> the element type * @param <I> the input element type
* @param <O> the output element type
* @param iterable the iterable to transform, may be null * @param iterable the iterable to transform, may be null
* @param transformer the transformer , must not be null * @param transformer the transformer , must not be null
* @return a transformed view of the specified iterable * @return a transformed view of the specified iterable
@ -353,7 +351,7 @@ public class IterableUtils {
@Override @Override
public Iterator<O> iterator() { public Iterator<O> iterator() {
return IteratorUtils.transformedIterator(emptyIteratorIfNull(iterable), transformer); return IteratorUtils.transformedIterator(emptyIteratorIfNull(iterable), transformer);
} }
}; };
} }
@ -374,7 +372,7 @@ public class IterableUtils {
@Override @Override
public Iterator<E> iterator() { public Iterator<E> iterator() {
return new UniqueFilterIterator<E>(emptyIteratorIfNull(iterable)); return new UniqueFilterIterator<E>(emptyIteratorIfNull(iterable));
} }
}; };
} }
@ -412,8 +410,7 @@ public class IterableUtils {
* input iterator supports it. * input iterator supports it.
* *
* @param <E> the element type * @param <E> the element type
* @param a the first iterable * @param iterables the array of iterables to interleave
* @param b the second iterable
* @return a new iterable, interleaving the provided iterables * @return a new iterable, interleaving the provided iterables
*/ */
public static <E> Iterable<E> zippingIterable(final Iterable<E>... iterables) { public static <E> Iterable<E> zippingIterable(final Iterable<E>... iterables) {
@ -426,7 +423,7 @@ public class IterableUtils {
iterators[i] = emptyIteratorIfNull(iterables[i]); iterators[i] = emptyIteratorIfNull(iterables[i]);
} }
return new ZippingIterator<E>(iterators); return new ZippingIterator<E>(iterators);
} }
}; };
} }
@ -463,7 +460,7 @@ public class IterableUtils {
* A <code>null</code> or empty iterable returns true. * A <code>null</code> or empty iterable returns true.
* *
* @param <E> the type of object the {@link Iterable} contains * @param <E> the type of object the {@link Iterable} contains
* @param input the {@link Iterable} to use, may be null * @param iterable the {@link Iterable} to use, may be null
* @param predicate the predicate to use, may not be null * @param predicate the predicate to use, may not be null
* @return true if every element of the collection matches the predicate or if the * @return true if every element of the collection matches the predicate or if the
* collection is empty, false otherwise * collection is empty, false otherwise
@ -479,7 +476,7 @@ public class IterableUtils {
* A <code>null</code> or empty iterable returns false. * A <code>null</code> or empty iterable returns false.
* *
* @param <E> the type of object the {@link Iterable} contains * @param <E> the type of object the {@link Iterable} contains
* @param input the {@link Iterable} to use, may be null * @param iterable the {@link Iterable} to use, may be null
* @param predicate the predicate to use, may not be null * @param predicate the predicate to use, may not be null
* @return true if any element of the collection matches the predicate, false otherwise * @return true if any element of the collection matches the predicate, false otherwise
* @throws NullPointerException if predicate is null * @throws NullPointerException if predicate is null
@ -493,7 +490,7 @@ public class IterableUtils {
* <p> * <p>
* A <code>null</code> iterable returns true. * A <code>null</code> iterable returns true.
* *
* @param iterable the {@link Iterable to use}, may be null * @param iterable the {@link Iterable to use}, may be null
* @return true if the iterable is null or empty, false otherwise * @return true if the iterable is null or empty, false otherwise
*/ */
public static boolean isEmpty(final Iterable<?> iterable) { public static boolean isEmpty(final Iterable<?> iterable) {
@ -510,7 +507,7 @@ public class IterableUtils {
* A <code>null</code> or empty iterable returns false. * A <code>null</code> or empty iterable returns false.
* *
* @param <E> the type of object the {@link Iterable} contains * @param <E> the type of object the {@link Iterable} contains
* @param iterator the iterable to check, may be null * @param iterable the iterable to check, may be null
* @param object the object to check * @param object the object to check
* @return true if the object is contained in the iterable, false otherwise * @return true if the object is contained in the iterable, false otherwise
*/ */

View File

@ -138,7 +138,7 @@ public class IteratorUtils {
/** /**
* IteratorUtils is not normally instantiated. * IteratorUtils is not normally instantiated.
*/ */
private IteratorUtils() {} private IteratorUtils() {}
// Empty // Empty
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
@ -937,7 +937,7 @@ public class IteratorUtils {
* @param <E> the element type * @param <E> the element type
* @param a the first iterator to interleave * @param a the first iterator to interleave
* @param b the second iterator to interleave * @param b the second iterator to interleave
* @param c the third iterator to interleave * @param c the third iterator to interleave
* @return an iterator, interleaving the decorated iterators * @return an iterator, interleaving the decorated iterators
* @throws IllegalArgumentException if any iterator is null * @throws IllegalArgumentException if any iterator is null
* @since 4.1 * @since 4.1
@ -1250,7 +1250,7 @@ public class IteratorUtils {
* A <code>null</code> or empty iterator returns false. * A <code>null</code> or empty iterator returns false.
* *
* @param <E> the type of object the {@link Iterator} contains * @param <E> the type of object the {@link Iterator} contains
* @param input the {@link Iterator} to use, may be null * @param iterator the {@link Iterator} to use, may be null
* @param predicate the predicate to use, may not be null * @param predicate the predicate to use, may not be null
* @return true if any element of the collection matches the predicate, false otherwise * @return true if any element of the collection matches the predicate, false otherwise
* @throws NullPointerException if predicate is null * @throws NullPointerException if predicate is null
@ -1278,7 +1278,7 @@ public class IteratorUtils {
* A <code>null</code> or empty iterator returns true. * A <code>null</code> or empty iterator returns true.
* *
* @param <E> the type of object the {@link Iterator} contains * @param <E> the type of object the {@link Iterator} contains
* @param input the {@link Iterator} to use, may be null * @param iterator the {@link Iterator} to use, may be null
* @param predicate the predicate to use, may not be null * @param predicate the predicate to use, may not be null
* @return true if every element of the collection matches the predicate or if the * @return true if every element of the collection matches the predicate or if the
* collection is empty, false otherwise * collection is empty, false otherwise
@ -1386,7 +1386,7 @@ public class IteratorUtils {
* converted to strings as by {@code String.valueOf(Object)}. * converted to strings as by {@code String.valueOf(Object)}.
* *
* @param <E> the element type * @param <E> the element type
* @param iterable the iterator to convert to a string * @param iterator the iterator to convert to a string
* @return a string representation of {@code iterator} * @return a string representation of {@code iterator}
* @since 4.1 * @since 4.1
*/ */
@ -1405,7 +1405,7 @@ public class IteratorUtils {
* converted to strings as by using the provided {@code transformer}. * converted to strings as by using the provided {@code transformer}.
* *
* @param <E> the element type * @param <E> the element type
* @param iterable the iterator to convert to a string, may be null * @param iterator the iterator to convert to a string, may be null
* @param transformer the transformer used to get a string representation of an element * @param transformer the transformer used to get a string representation of an element
* @return a string representation of {@code iterator} * @return a string representation of {@code iterator}
* @throws NullPointerException if {@code transformer} is null * @throws NullPointerException if {@code transformer} is null

View File

@ -167,6 +167,7 @@ public class SetUtils {
* using {@link java.util.Collections#synchronizedSet(Set)}. This class may throw * using {@link java.util.Collections#synchronizedSet(Set)}. This class may throw
* exceptions when accessed by concurrent threads without synchronization. * exceptions when accessed by concurrent threads without synchronization.
* *
* @param <E> the element type
* @return a new identity hash set * @return a new identity hash set
* @since 4.1 * @since 4.1
*/ */