You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2012/06/23 19:46:17 UTC
svn commit: r1353166 - in
/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list:
FixedSizeList.java GrowthList.java LazyList.java PredicatedList.java
SynchronizedList.java TransformedList.java UnmodifiableList.java
Author: tn
Date: Sat Jun 23 17:46:15 2012
New Revision: 1353166
URL: http://svn.apache.org/viewvc?rev=1353166&view=rev
Log:
[COLLECTIONS-231] apply signature change to factory method.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/FixedSizeList.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/GrowthList.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/LazyList.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/PredicatedList.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/SynchronizedList.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/TransformedList.java
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/UnmodifiableList.java
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/FixedSizeList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/FixedSizeList.java?rev=1353166&r1=1353165&r2=1353166&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/FixedSizeList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/FixedSizeList.java Sat Jun 23 17:46:15 2012
@@ -49,10 +49,12 @@ public class FixedSizeList<E>
/**
* Factory method to create a fixed size list.
*
+ * @param <E> the type of the elements in the list
* @param list the list to decorate, must not be null
+ * @return a new fixed size list
* @throws IllegalArgumentException if list is null
*/
- public static <E> List<E> fixedSizeList(List<E> list) {
+ public static <E> FixedSizeList<E> fixedSizeList(List<E> list) {
return new FixedSizeList<E>(list);
}
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/GrowthList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/GrowthList.java?rev=1353166&r1=1353165&r2=1353166&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/GrowthList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/GrowthList.java Sat Jun 23 17:46:15 2012
@@ -63,10 +63,12 @@ public class GrowthList<E> extends Abstr
/**
* Factory method to create a growth list.
*
+ * @param <E> the type of the elements in the list
* @param list the list to decorate, must not be null
+ * @return a new growth list
* @throws IllegalArgumentException if list is null
*/
- public static <E> List<E> growthList(List<E> list) {
+ public static <E> GrowthList<E> growthList(List<E> list) {
return new GrowthList<E>(list);
}
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/LazyList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/LazyList.java?rev=1353166&r1=1353165&r2=1353166&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/LazyList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/LazyList.java Sat Jun 23 17:46:15 2012
@@ -72,11 +72,13 @@ public class LazyList<E> extends Abstrac
/**
* Factory method to create a lazily instantiating list.
*
+ * @param <E> the type of the elements in the list
* @param list the list to decorate, must not be null
* @param factory the factory to use for creation, must not be null
+ * @return a new lazy list
* @throws IllegalArgumentException if list or factory is null
*/
- public static <E> List<E> lazyList(List<E> list, Factory<? extends E> factory) {
+ public static <E> LazyList<E> lazyList(List<E> list, Factory<? extends E> factory) {
return new LazyList<E>(list, factory);
}
@@ -106,6 +108,7 @@ public class LazyList<E> extends Abstrac
* placeholder that is replaced with a factory object when requested.
*
* @param index the index to retrieve
+ * {@inheritDoc}
*/
@Override
public E get(int index) {
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/PredicatedList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/PredicatedList.java?rev=1353166&r1=1353165&r2=1353166&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/PredicatedList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/PredicatedList.java Sat Jun 23 17:46:15 2012
@@ -54,13 +54,14 @@ public class PredicatedList<E> extends P
* If there are any elements already in the list being decorated, they
* are validated.
*
+ * @param <T> the type of the elements in the list
* @param list the list to decorate, must not be null
* @param predicate the predicate to use for validation, must not be null
- * @return the decorated list
+ * @return a new predicated list
* @throws IllegalArgumentException if list or predicate is null
* @throws IllegalArgumentException if the list contains invalid elements
*/
- public static <T> List<T> predicatedList(List<T> list, Predicate<? super T> predicate) {
+ public static <T> PredicatedList<T> predicatedList(List<T> list, Predicate<? super T> predicate) {
return new PredicatedList<T>(list, predicate);
}
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/SynchronizedList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/SynchronizedList.java?rev=1353166&r1=1353165&r2=1353166&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/SynchronizedList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/SynchronizedList.java Sat Jun 23 17:46:15 2012
@@ -43,10 +43,12 @@ public class SynchronizedList<E> extends
/**
* Factory method to create a synchronized list.
*
+ * @param <T> the type of the elements in the list
* @param list the list to decorate, must not be null
+ * @return a new synchronized list
* @throws IllegalArgumentException if list is null
*/
- public static <T> List<T> synchronizedList(List<T> list) {
+ public static <T> SynchronizedList<T> synchronizedList(List<T> list) {
return new SynchronizedList<T>(list);
}
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/TransformedList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/TransformedList.java?rev=1353166&r1=1353165&r2=1353166&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/TransformedList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/TransformedList.java Sat Jun 23 17:46:15 2012
@@ -51,11 +51,14 @@ public class TransformedList<E> extends
* are NOT transformed.
* Contrast this with {@link #transformedList(List, Transformer)}.
*
+ * @param <E> the type of the elements in the list
* @param list the list to decorate, must not be null
* @param transformer the transformer to use for conversion, must not be null
+ * @return a new transformed list
* @throws IllegalArgumentException if list or transformer is null
*/
- public static <E> List<E> transformingList(List<E> list, Transformer<? super E, ? extends E> transformer) {
+ public static <E> TransformedList<E> transformingList(List<E> list,
+ Transformer<? super E, ? extends E> transformer) {
return new TransformedList<E>(list, transformer);
}
@@ -67,13 +70,15 @@ public class TransformedList<E> extends
* will be transformed by this method.
* Contrast this with {@link #transformingList(List, Transformer)}.
*
+ * @param <E> the type of the elements in the list
* @param list the list to decorate, must not be null
* @param transformer the transformer to use for conversion, must not be null
* @return a new transformed List
* @throws IllegalArgumentException if list or transformer is null
* @since Commons Collections 3.3
*/
- public static <E> List<E> transformedList(List<E> list, Transformer<? super E, ? extends E> transformer) {
+ public static <E> TransformedList<E> transformedList(List<E> list,
+ Transformer<? super E, ? extends E> transformer) {
TransformedList<E> decorated = new TransformedList<E>(list, transformer);
if (transformer != null && list != null && list.size() > 0) {
@SuppressWarnings("unchecked") // list is of type E
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/UnmodifiableList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/UnmodifiableList.java?rev=1353166&r1=1353165&r2=1353166&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/UnmodifiableList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/UnmodifiableList.java Sat Jun 23 17:46:15 2012
@@ -47,7 +47,9 @@ public final class UnmodifiableList<E>
/**
* Factory method to create an unmodifiable list.
*
+ * @param <E> the type of the elements in the list
* @param list the list to decorate, must not be null
+ * @return a new unmodifiable list
* @throws IllegalArgumentException if list is null
*/
public static <E> List<E> unmodifiableList(List<E> list) {