commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/iterators UniqueFilterIterator.java
Date Fri, 16 May 2003 14:20:01 GMT
scolebourne    2003/05/16 07:20:01

  Modified:    collections/src/java/org/apache/commons/collections/iterators
                        UniqueFilterIterator.java
  Log:
  Change to use PredicateUtils rather than own Predicate
  
  Revision  Changes    Path
  1.4       +5 -16     jakarta-commons/collections/src/java/org/apache/commons/collections/iterators/UniqueFilterIterator.java
  
  Index: UniqueFilterIterator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/iterators/UniqueFilterIterator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- UniqueFilterIterator.java	15 Jan 2003 21:49:14 -0000	1.3
  +++ UniqueFilterIterator.java	16 May 2003 14:20:01 -0000	1.4
  @@ -57,9 +57,9 @@
    */
   package org.apache.commons.collections.iterators;
   
  -import java.util.HashSet;
   import java.util.Iterator;
  -import org.apache.commons.collections.Predicate;
  +
  +import org.apache.commons.collections.PredicateUtils;
   
   /** 
    * A FilterIterator which only returns "unique" Objects.  Internally,
  @@ -81,18 +81,7 @@
        *  @param iterator  the iterator to use
        */
       public UniqueFilterIterator( Iterator iterator ) {
  -        super( iterator, new UniquePredicate() );
  -    }
  -
  -    /**
  -     * Private Predicate needed to implement the unique behaviour.
  -     */
  -    private static class UniquePredicate implements Predicate {
  -        HashSet set = new HashSet();
  -
  -        public boolean evaluate(Object object) {
  -            return set.add(object);       
  -        }
  +        super(iterator, PredicateUtils.uniquePredicate());
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message