Renamed Factory.createObject() to Factory.create().
PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8ab071ff5d
commit
fceaa29c48
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Factory.java,v 1.1 2002/08/13 01:19:00 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Factory.java,v 1.2 2002/08/15 20:09:37 pjack Exp $
|
||||||
* $Revision: 1.1 $
|
* $Revision: 1.2 $
|
||||||
* $Date: 2002/08/13 01:19:00 $
|
* $Date: 2002/08/15 20:09:37 $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -68,7 +68,7 @@ import java.lang.reflect.*;
|
||||||
* to create an object.
|
* to create an object.
|
||||||
*
|
*
|
||||||
* @author Arron Bates
|
* @author Arron Bates
|
||||||
* @version $Revision: 1.1 $
|
* @version $Revision: 1.2 $
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
public interface Factory {
|
public interface Factory {
|
||||||
|
@ -77,6 +77,6 @@ public interface Factory {
|
||||||
*
|
*
|
||||||
* @return Object reference to the new object.
|
* @return Object reference to the new object.
|
||||||
*/
|
*/
|
||||||
public Object createObject();
|
public Object create();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/FactoryUtils.java,v 1.4 2002/08/15 20:04:31 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/FactoryUtils.java,v 1.5 2002/08/15 20:09:37 pjack Exp $
|
||||||
* $Revision: 1.4 $
|
* $Revision: 1.5 $
|
||||||
* $Date: 2002/08/15 20:04:31 $
|
* $Date: 2002/08/15 20:09:37 $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -69,7 +69,7 @@ import java.lang.reflect.*;
|
||||||
* objects.
|
* objects.
|
||||||
*
|
*
|
||||||
* @author Arron Bates
|
* @author Arron Bates
|
||||||
* @version $Revision: 1.4 $
|
* @version $Revision: 1.5 $
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
public class FactoryUtils {
|
public class FactoryUtils {
|
||||||
|
@ -135,7 +135,7 @@ public class FactoryUtils {
|
||||||
* Thinly disguising the error as a null pointer, with a modified message for
|
* Thinly disguising the error as a null pointer, with a modified message for
|
||||||
* debugging.
|
* debugging.
|
||||||
*/
|
*/
|
||||||
public Object createObject() {
|
public Object create() {
|
||||||
|
|
||||||
Object obj = null;
|
Object obj = null;
|
||||||
/* for catching error specifics */
|
/* for catching error specifics */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/ListUtils.java,v 1.7 2002/08/15 20:04:31 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/ListUtils.java,v 1.8 2002/08/15 20:09:37 pjack Exp $
|
||||||
* $Revision: 1.7 $
|
* $Revision: 1.8 $
|
||||||
* $Date: 2002/08/15 20:04:31 $
|
* $Date: 2002/08/15 20:09:37 $
|
||||||
*
|
*
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
|
@ -463,7 +463,7 @@ public class ListUtils
|
||||||
obj = getList().get(index);
|
obj = getList().get(index);
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
/* item is a place holder, create new one, set and return */
|
/* item is a place holder, create new one, set and return */
|
||||||
obj = this.factory.createObject();
|
obj = this.factory.create();
|
||||||
this.getList().set(index, obj);
|
this.getList().set(index, obj);
|
||||||
return obj;
|
return obj;
|
||||||
} else {
|
} else {
|
||||||
|
@ -476,7 +476,7 @@ public class ListUtils
|
||||||
getList().add(null);
|
getList().add(null);
|
||||||
}
|
}
|
||||||
/* create our last object, set and return */
|
/* create our last object, set and return */
|
||||||
obj = this.factory.createObject();
|
obj = this.factory.create();
|
||||||
getList().add(obj);
|
getList().add(obj);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
@ -554,7 +554,7 @@ public class ListUtils
|
||||||
*
|
*
|
||||||
* <Pre>
|
* <Pre>
|
||||||
* Factory factory = new Factory() {
|
* Factory factory = new Factory() {
|
||||||
* public Object createObject() {
|
* public Object create() {
|
||||||
* return new Date();
|
* return new Date();
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/MapUtils.java,v 1.8 2002/08/15 20:04:31 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/MapUtils.java,v 1.9 2002/08/15 20:09:37 pjack Exp $
|
||||||
* $Revision: 1.8 $
|
* $Revision: 1.9 $
|
||||||
* $Date: 2002/08/15 20:04:31 $
|
* $Date: 2002/08/15 20:09:37 $
|
||||||
*
|
*
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
|
@ -922,7 +922,7 @@ public class MapUtils {
|
||||||
|
|
||||||
public Object get(Object key) {
|
public Object get(Object key) {
|
||||||
if (!map.containsKey(key)) {
|
if (!map.containsKey(key)) {
|
||||||
Object value = factory.createObject();
|
Object value = factory.create();
|
||||||
map.put(key, value);
|
map.put(key, value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -1114,7 +1114,7 @@ public class MapUtils {
|
||||||
*
|
*
|
||||||
* <Pre>
|
* <Pre>
|
||||||
* Factory factory = new Factory() {
|
* Factory factory = new Factory() {
|
||||||
* public Object createObject() {
|
* public Object create() {
|
||||||
* return new Date();
|
* return new Date();
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
|
@ -1177,7 +1177,7 @@ public class MapUtils {
|
||||||
*
|
*
|
||||||
* <Pre>
|
* <Pre>
|
||||||
* Factory factory = new Factory() {
|
* Factory factory = new Factory() {
|
||||||
* public Object createObject() {
|
* public Object create() {
|
||||||
* return new Date();
|
* return new Date();
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestListUtils.java,v 1.2 2002/08/13 01:19:00 pjack Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestListUtils.java,v 1.3 2002/08/15 20:09:38 pjack Exp $
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
* $Date: 2002/08/13 01:19:00 $
|
* $Date: 2002/08/15 20:09:38 $
|
||||||
*
|
*
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
|
@ -136,7 +136,7 @@ public class TestListUtils extends BulkTest {
|
||||||
|
|
||||||
private int index;
|
private int index;
|
||||||
|
|
||||||
public Object createObject() {
|
public Object create() {
|
||||||
index++;
|
index++;
|
||||||
return new Integer(index);
|
return new Integer(index);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue