Added missing javadoc, minor checkstyle fixes.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1377069 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
68768dbe42
commit
677f9b4e26
|
@ -43,7 +43,8 @@ public class BagUtils {
|
|||
/**
|
||||
* An empty unmodifiable sorted bag.
|
||||
*/
|
||||
public static final Bag<Object> EMPTY_SORTED_BAG = UnmodifiableSortedBag.unmodifiableSortedBag(new TreeBag<Object>());
|
||||
public static final Bag<Object> EMPTY_SORTED_BAG =
|
||||
UnmodifiableSortedBag.unmodifiableSortedBag(new TreeBag<Object>());
|
||||
|
||||
/**
|
||||
* Instantiation of BagUtils is not intended or required. However, some
|
||||
|
@ -74,6 +75,7 @@ public class BagUtils {
|
|||
*
|
||||
* Failure to follow this advice may result in non-deterministic behavior.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param bag the bag to synchronize, must not be null
|
||||
* @return a synchronized bag backed by that bag
|
||||
* @throws IllegalArgumentException if the Bag is null
|
||||
|
@ -86,8 +88,8 @@ public class BagUtils {
|
|||
* Returns an unmodifiable view of the given bag. Any modification attempts
|
||||
* to the returned bag will raise an {@link UnsupportedOperationException}.
|
||||
*
|
||||
* @param bag the bag whose unmodifiable view is to be returned, must not be
|
||||
* null
|
||||
* @param <E> the element type
|
||||
* @param bag the bag whose unmodifiable view is to be returned, must not be null
|
||||
* @return an unmodifiable view of that bag
|
||||
* @throws IllegalArgumentException if the Bag is null
|
||||
*/
|
||||
|
@ -104,6 +106,7 @@ public class BagUtils {
|
|||
* after invoking this method, as it is a backdoor for adding invalid
|
||||
* objects.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param bag the bag to predicate, must not be null
|
||||
* @param predicate the predicate for the bag, must not be null
|
||||
* @return a predicated bag backed by the given bag
|
||||
|
@ -123,6 +126,7 @@ public class BagUtils {
|
|||
* Existing entries in the specified bag will not be transformed.
|
||||
* If you want that behaviour, see {@link TransformedBag#transformedBag(Bag, Transformer)}.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param bag the bag to predicate, must not be null
|
||||
* @param transformer the transformer for the bag, must not be null
|
||||
* @return a transformed bag backed by the given bag
|
||||
|
@ -154,6 +158,7 @@ public class BagUtils {
|
|||
*
|
||||
* Failure to follow this advice may result in non-deterministic behavior.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param bag the bag to synchronize, must not be null
|
||||
* @return a synchronized bag backed by that bag
|
||||
* @throws IllegalArgumentException if the SortedBag is null
|
||||
|
@ -167,8 +172,8 @@ public class BagUtils {
|
|||
* attempts to the returned bag will raise an
|
||||
* {@link UnsupportedOperationException}.
|
||||
*
|
||||
* @param bag the bag whose unmodifiable view is to be returned, must not be
|
||||
* null
|
||||
* @param <E> the element type
|
||||
* @param bag the bag whose unmodifiable view is to be returned, must not be null
|
||||
* @return an unmodifiable view of that bag
|
||||
* @throws IllegalArgumentException if the SortedBag is null
|
||||
*/
|
||||
|
@ -186,6 +191,7 @@ public class BagUtils {
|
|||
* after invoking this method, as it is a backdoor for adding invalid
|
||||
* objects.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param bag the sorted bag to predicate, must not be null
|
||||
* @param predicate the predicate for the bag, must not be null
|
||||
* @return a predicated bag backed by the given bag
|
||||
|
@ -204,21 +210,25 @@ public class BagUtils {
|
|||
* as it is a backdoor for adding untransformed objects.
|
||||
* <p>
|
||||
* Existing entries in the specified bag will not be transformed.
|
||||
* If you want that behaviour, see {@link TransformedSortedBag#transformedSortedBag(SortedBag, Transformer)}.
|
||||
* If you want that behaviour, see
|
||||
* {@link TransformedSortedBag#transformedSortedBag(SortedBag, Transformer)}.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param bag the bag to predicate, must not be null
|
||||
* @param transformer the transformer for the bag, must not be null
|
||||
* @return a transformed bag backed by the given bag
|
||||
* @throws IllegalArgumentException if the Bag or Transformer is null
|
||||
*/
|
||||
public static <E> SortedBag<E> transformingSortedBag(SortedBag<E> bag, Transformer<? super E, ? extends E> transformer) {
|
||||
public static <E> SortedBag<E> transformingSortedBag(SortedBag<E> bag,
|
||||
Transformer<? super E, ? extends E> transformer) {
|
||||
return TransformedSortedBag.transformingSortedBag(bag, transformer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an empty <code>Bag</code>.
|
||||
* @param <E>
|
||||
* @return Bag<E>
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @return an empty Bag
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E> Bag<E> emptyBag() {
|
||||
|
@ -227,8 +237,9 @@ public class BagUtils {
|
|||
|
||||
/**
|
||||
* Get an empty <code>SortedBag</code>.
|
||||
* @param <E>
|
||||
* @return SortedBag<E>
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @return an empty sorted Bag
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E> SortedBag<E> emptySortedBag() {
|
||||
|
|
|
@ -44,7 +44,9 @@ public class EnumerationUtils {
|
|||
* <p>As the enumeration is traversed, an ArrayList of its values is
|
||||
* created. The new list is returned.</p>
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param enumeration the enumeration to traverse, which should not be <code>null</code>.
|
||||
* @return a list containing all elements of the given enumeration
|
||||
* @throws NullPointerException if the enumeration parameter is <code>null</code>.
|
||||
*/
|
||||
public static <E> List<E> toList(Enumeration<E> enumeration) {
|
||||
|
|
|
@ -50,8 +50,8 @@ public class SetUtils {
|
|||
|
||||
/**
|
||||
* Get a typed empty unmodifiable Set.
|
||||
* @param <E>
|
||||
* @return Set<E>
|
||||
* @param <E> the element type
|
||||
* @return an empty Set
|
||||
*/
|
||||
public static <E> Set<E> emptySet() {
|
||||
return Collections.<E>emptySet();
|
||||
|
@ -61,12 +61,13 @@ public class SetUtils {
|
|||
* An empty unmodifiable sorted set.
|
||||
* This is not provided in the JDK.
|
||||
*/
|
||||
public static final SortedSet<?> EMPTY_SORTED_SET = UnmodifiableSortedSet.unmodifiableSortedSet(new TreeSet<Object>());
|
||||
public static final SortedSet<?> EMPTY_SORTED_SET =
|
||||
UnmodifiableSortedSet.unmodifiableSortedSet(new TreeSet<Object>());
|
||||
|
||||
/**
|
||||
* Get a typed empty unmodifiable sorted set.
|
||||
* @param <E>
|
||||
* @return SortedSet<E>
|
||||
* @param <E> the element type
|
||||
* @return an empty sorted Set
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E> SortedSet<E> emptySortedSet() {
|
||||
|
@ -127,6 +128,7 @@ public class SetUtils {
|
|||
* extend AbstractSet. The method takes Collection instances to enable other
|
||||
* collection types to use the Set implementation algorithm.
|
||||
*
|
||||
* @param <T> the element type
|
||||
* @see java.util.Set#hashCode()
|
||||
* @param set the set to calculate the hash code for, may be null
|
||||
* @return the hash code
|
||||
|
@ -164,11 +166,12 @@ public class SetUtils {
|
|||
*
|
||||
* This method uses the implementation in the decorators subpackage.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param set the set to synchronize, must not be null
|
||||
* @return a synchronized set backed by the given set
|
||||
* @throws IllegalArgumentException if the set is null
|
||||
*/
|
||||
public static <T> Set<T> synchronizedSet(Set<T> set) {
|
||||
public static <E> Set<E> synchronizedSet(Set<E> set) {
|
||||
return SynchronizedSet.synchronizedSet(set);
|
||||
}
|
||||
|
||||
|
@ -177,6 +180,7 @@ public class SetUtils {
|
|||
* <p>
|
||||
* This method uses the implementation in the decorators subpackage.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param set the set to make unmodifiable, must not be null
|
||||
* @return an unmodifiable set backed by the given set
|
||||
* @throws IllegalArgumentException if the set is null
|
||||
|
@ -193,12 +197,13 @@ public class SetUtils {
|
|||
* It is important not to use the original set after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param set the set to predicate, must not be null
|
||||
* @param predicate the predicate for the set, must not be null
|
||||
* @return a predicated set backed by the given set
|
||||
* @throws IllegalArgumentException if the Set or Predicate is null
|
||||
*/
|
||||
public static <T> Set<T> predicatedSet(Set<T> set, Predicate<? super T> predicate) {
|
||||
public static <E> Set<E> predicatedSet(Set<E> set, Predicate<? super E> predicate) {
|
||||
return PredicatedSet.predicatedSet(set, predicate);
|
||||
}
|
||||
|
||||
|
@ -212,6 +217,7 @@ public class SetUtils {
|
|||
* Existing entries in the specified set will not be transformed.
|
||||
* If you want that behaviour, see {@link TransformedSet#transformedSet}.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param set the set to transform, must not be null
|
||||
* @param transformer the transformer for the set, must not be null
|
||||
* @return a transformed set backed by the given set
|
||||
|
@ -228,6 +234,7 @@ public class SetUtils {
|
|||
* If an element is added twice, the order is determined by the first add.
|
||||
* The order is observed through the iterator or toArray.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param set the set to order, must not be null
|
||||
* @return an ordered set backed by the given set
|
||||
* @throws IllegalArgumentException if the Set is null
|
||||
|
@ -255,11 +262,12 @@ public class SetUtils {
|
|||
*
|
||||
* This method uses the implementation in the decorators subpackage.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param set the sorted set to synchronize, must not be null
|
||||
* @return a synchronized set backed by the given set
|
||||
* @throws IllegalArgumentException if the set is null
|
||||
*/
|
||||
public static <T> SortedSet<T> synchronizedSortedSet(SortedSet<T> set) {
|
||||
public static <E> SortedSet<E> synchronizedSortedSet(SortedSet<E> set) {
|
||||
return SynchronizedSortedSet.synchronizedSortedSet(set);
|
||||
}
|
||||
|
||||
|
@ -268,11 +276,12 @@ public class SetUtils {
|
|||
* <p>
|
||||
* This method uses the implementation in the decorators subpackage.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param set the sorted set to make unmodifiable, must not be null
|
||||
* @return an unmodifiable set backed by the given set
|
||||
* @throws IllegalArgumentException if the set is null
|
||||
*/
|
||||
public static <T> SortedSet<T> unmodifiableSortedSet(SortedSet<T> set) {
|
||||
public static <E> SortedSet<E> unmodifiableSortedSet(SortedSet<E> set) {
|
||||
return UnmodifiableSortedSet.unmodifiableSortedSet(set);
|
||||
}
|
||||
|
||||
|
@ -284,12 +293,13 @@ public class SetUtils {
|
|||
* It is important not to use the original set after invoking this method,
|
||||
* as it is a backdoor for adding invalid objects.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param set the sorted set to predicate, must not be null
|
||||
* @param predicate the predicate for the sorted set, must not be null
|
||||
* @return a predicated sorted set backed by the given sorted set
|
||||
* @throws IllegalArgumentException if the Set or Predicate is null
|
||||
*/
|
||||
public static <T> SortedSet<T> predicatedSortedSet(SortedSet<T> set, Predicate<? super T> predicate) {
|
||||
public static <E> SortedSet<E> predicatedSortedSet(SortedSet<E> set, Predicate<? super E> predicate) {
|
||||
return PredicatedSortedSet.predicatedSortedSet(set, predicate);
|
||||
}
|
||||
|
||||
|
@ -303,12 +313,14 @@ public class SetUtils {
|
|||
* Existing entries in the specified set will not be transformed.
|
||||
* If you want that behaviour, see {@link TransformedSortedSet#transformedSortedSet}.
|
||||
*
|
||||
* @param <E> the element type
|
||||
* @param set the set to transform, must not be null
|
||||
* @param transformer the transformer for the set, must not be null
|
||||
* @return a transformed set backed by the given set
|
||||
* @throws IllegalArgumentException if the Set or Transformer is null
|
||||
*/
|
||||
public static <E> SortedSet<E> transformedSortedSet(SortedSet<E> set, Transformer<? super E, ? extends E> transformer) {
|
||||
public static <E> SortedSet<E> transformedSortedSet(SortedSet<E> set,
|
||||
Transformer<? super E, ? extends E> transformer) {
|
||||
return TransformedSortedSet.transformingSortedSet(set, transformer);
|
||||
}
|
||||
|
||||
|
|
|
@ -198,8 +198,8 @@ public class SplitMapUtils {
|
|||
* If <code>get</code> implements {@link IterableMap} directly, no conversion will take place.
|
||||
* If <code>get</code> implements {@link Map} but not {@link IterableMap} it will be decorated.
|
||||
* Otherwise an {@link Unmodifiable} {@link IterableMap} will be returned.
|
||||
* @param <K>
|
||||
* @param <V>
|
||||
* @param <K> the key type
|
||||
* @param <V> the value type
|
||||
* @param get to wrap, must not be null
|
||||
* @return {@link IterableMap}
|
||||
*/
|
||||
|
@ -222,8 +222,8 @@ public class SplitMapUtils {
|
|||
* it is recommended that the result of #put(K, V) be discarded as it likely will not
|
||||
* match <code>V</code> at runtime.
|
||||
*
|
||||
* @param <K>
|
||||
* @param <V>
|
||||
* @param <K> the key type
|
||||
* @param <V> the element type
|
||||
* @param put to wrap, must not be null
|
||||
* @return {@link Map}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue