You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by pj...@apache.org on 2002/08/13 03:19:01 UTC

cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections TestListUtils.java

pjack       2002/08/12 18:19:01

  Modified:    collections/src/java/org/apache/commons/collections
                        FactoryUtils.java ListUtils.java MapUtils.java
               collections/src/test/org/apache/commons/collections
                        TestListUtils.java
  Added:       collections/src/java/org/apache/commons/collections
                        Factory.java
  Removed:     collections/src/java/org/apache/commons/collections
                        SimpleObjectFactory.java
  Log:
  Renamed SimpleObjectFactory to Factory.
  
  Revision  Changes    Path
  1.3       +9 -9      jakarta-commons/collections/src/java/org/apache/commons/collections/FactoryUtils.java
  
  Index: FactoryUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/FactoryUtils.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FactoryUtils.java	13 Aug 2002 00:46:25 -0000	1.2
  +++ FactoryUtils.java	13 Aug 2002 01:19:00 -0000	1.3
  @@ -74,17 +74,17 @@
    */
   public class FactoryUtils {
     
  -  /** Creates a SimpleObjectFactory whith a class definition, which will be
  +  /** Creates a Factory whith a class definition, which will be
      * used to create a new object from an empty constructor.
      *
      * @param inClass class definition which will be ued to create the new object
      * @return the simple object factory.
      */
  -  public static SimpleObjectFactory createStandardFactory(Class inClass) {
  +  public static Factory createStandardFactory(Class inClass) {
       return new StandardFactory(inClass);
     }
     
  -  /** Creates a SimpleObjectFactory whith the class definition and argument
  +  /** Creates a Factory whith the class definition and argument
      * details, which can create a new object from a constructor which requires
      * arguments.
      *
  @@ -93,7 +93,7 @@
      * @param argObjects the objects for the arguments themselves
      * @return the simple object factory.
      */
  -  public static SimpleObjectFactory createStandardFactory(Class inClass,
  +  public static Factory createStandardFactory(Class inClass,
                                                             Class[] argTypes,
                                                             Object[] argObjects) {
       return new StandardFactory(inClass, argTypes, argObjects);
  @@ -104,7 +104,7 @@
     /* A simple factory, which takes the bare bones of object creation to do just
      * that, create new objects.
      */
  -  private static class StandardFactory implements SimpleObjectFactory {
  +  private static class StandardFactory implements Factory {
       
       /* builds the object factory. The class definition can creat objects which
        * have no-argument constructors.
  
  
  
  1.6       +7 -7      jakarta-commons/collections/src/java/org/apache/commons/collections/ListUtils.java
  
  Index: ListUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/ListUtils.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ListUtils.java	13 Aug 2002 00:26:51 -0000	1.5
  +++ ListUtils.java	13 Aug 2002 01:19:00 -0000	1.6
  @@ -389,9 +389,9 @@
       static class LazyList extends CollectionUtils.CollectionWrapper 
       implements List {
   
  -        final protected SimpleObjectFactory factory;
  +        final protected Factory factory;
   
  -        public LazyList(List list, SimpleObjectFactory factory) {
  +        public LazyList(List list, Factory factory) {
               super(list);
               this.factory = factory;
           }
  @@ -502,7 +502,7 @@
        *  For instance:
        *
        *  <Pre>
  -     *  SimpleObjectFactory factory = new SimpleObjectFactory() {
  +     *  Factory factory = new Factory() {
        *      public Object createObject() {
        *          return new Date();
        *      }
  @@ -520,7 +520,7 @@
        *  @param factory  the factory for creating new objects
        *  @return a lazy list backed by the given list
        */
  -    public static List lazyList(List list, SimpleObjectFactory factory) {
  +    public static List lazyList(List list, Factory factory) {
           return new LazyList(list, factory);
       }
   
  
  
  
  1.7       +10 -10    jakarta-commons/collections/src/java/org/apache/commons/collections/MapUtils.java
  
  Index: MapUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/MapUtils.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MapUtils.java	13 Aug 2002 00:26:51 -0000	1.6
  +++ MapUtils.java	13 Aug 2002 01:19:00 -0000	1.7
  @@ -609,10 +609,10 @@
   
       static class LazyMap extends ProxyMap {
   
  -        final protected SimpleObjectFactory factory;
  +        final protected Factory factory;
   
   
  -        public LazyMap(Map map, SimpleObjectFactory factory) {
  +        public LazyMap(Map map, Factory factory) {
               super(map);
               this.factory = factory;
           }
  @@ -717,7 +717,7 @@
   
       static class LazySortedMap extends LazyMap implements SortedMap {
   
  -        public LazySortedMap(SortedMap m, SimpleObjectFactory factory) {
  +        public LazySortedMap(SortedMap m, Factory factory) {
               super(m, factory);
           }
   
  @@ -811,7 +811,7 @@
        *  For instance:
        *
        *  <Pre>
  -     *  SimpleObjectFactory factory = new SimpleObjectFactory() {
  +     *  Factory factory = new Factory() {
        *      public Object createObject() {
        *          return new Date();
        *      }
  @@ -828,7 +828,7 @@
        *  @param factory  the factory for creating new objects
        *  @return a lazy map backed by the given map
        */
  -    public static Map lazyMap(Map map, SimpleObjectFactory factory) {
  +    public static Map lazyMap(Map map, Factory factory) {
           return new LazyMap(map, factory);
       }
   
  @@ -874,7 +874,7 @@
        *  For instance:
        *
        *  <Pre>
  -     *  SimpleObjectFactory factory = new SimpleObjectFactory() {
  +     *  Factory factory = new Factory() {
        *      public Object createObject() {
        *          return new Date();
        *      }
  @@ -891,7 +891,7 @@
        *  @param factory  the factory for creating new objects
        *  @return a lazy map backed by the given map
        */
  -    public static SortedMap lazySortedMap(SortedMap map, SimpleObjectFactory factory) {
  +    public static SortedMap lazySortedMap(SortedMap map, Factory factory) {
           return new LazySortedMap(map, factory);
       }
   }
  
  
  
  1.1                  jakarta-commons/collections/src/java/org/apache/commons/collections/Factory.java
  
  Index: Factory.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/Factory.java,v 1.1 2002/08/13 01:19:00 pjack Exp $
   * $Revision: 1.1 $
   * $Date: 2002/08/13 01:19:00 $
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Struts", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  package org.apache.commons.collections;
  
  import java.util.*;
  import java.lang.reflect.*;
  
  /**
   * Factory
   * A simple interface that describes the most basic means of having the ability
   * to create an object.
   *
   * @author Arron Bates
   * @version $Revision: 1.1 $
   * @since 2.1
   */
  public interface Factory {
  
    /** Simple method from which will come the new object from the factory.
     *
     * @return Object reference to the new object.
     */
    public Object createObject();
    
  }
  
  
  
  1.2       +3 -3      jakarta-commons/collections/src/test/org/apache/commons/collections/TestListUtils.java
  
  Index: TestListUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestListUtils.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestListUtils.java	13 Aug 2002 00:26:52 -0000	1.1
  +++ TestListUtils.java	13 Aug 2002 01:19:00 -0000	1.2
  @@ -132,7 +132,7 @@
   
   
       public void testLazyList() {
  -        List list = ListUtils.lazyList(new ArrayList(), new SimpleObjectFactory() {
  +        List list = ListUtils.lazyList(new ArrayList(), new Factory() {
   
               private int index;
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>