From ffe28c43e0486d443234701ab9d791e703c88071 Mon Sep 17 00:00:00 2001 From: Rodney Waldhoff Date: Wed, 16 May 2001 22:19:23 +0000 Subject: [PATCH] Deprecating. I'd like to remove this class, if no one has any issues. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130482 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/collections/ListUtils.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/java/org/apache/commons/collections/ListUtils.java b/src/java/org/apache/commons/collections/ListUtils.java index 705610cf5..bb909698d 100644 --- a/src/java/org/apache/commons/collections/ListUtils.java +++ b/src/java/org/apache/commons/collections/ListUtils.java @@ -16,19 +16,20 @@ import java.util.List; * * @author Federico Barbieri * @author Peter Donald + * @deprecated See {@link org.apache.commons.collections.CollectionUtils}. */ public class ListUtils { - public static List intersection( final List list1, final List list2 ) + public static List intersection( final List list1, final List list2 ) { final ArrayList result = new ArrayList(); final Iterator iterator = list2.iterator(); - while( iterator.hasNext() ) + while( iterator.hasNext() ) { final Object o = iterator.next(); - if ( list1.contains( o ) ) + if ( list1.contains( o ) ) { result.add( o ); } @@ -36,27 +37,27 @@ public class ListUtils return result; } - - public static List subtract( final List list1, final List list2 ) + + public static List subtract( final List list1, final List list2 ) { final ArrayList result = new ArrayList( list1 ); final Iterator iterator = list2.iterator(); - while( iterator.hasNext() ) + while( iterator.hasNext() ) { result.remove( iterator.next() ); } return result; } - - public static List sum( final List list1, final List list2 ) + + public static List sum( final List list1, final List list2 ) { - return subtract( union( list1, list2 ), + return subtract( union( list1, list2 ), intersection( list1, list2 ) ); } - - public static List union( final List list1, final List list2 ) + + public static List union( final List list1, final List list2 ) { final ArrayList result = new ArrayList( list1 ); result.addAll( list2 );