Let's name our factory methods along the same lines as the pattern established

by Maps and friends.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2323 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2008-06-07 10:24:59 +00:00
parent f4ba889deb
commit 4aedf764ec
3 changed files with 7 additions and 8 deletions
@@ -673,5 +673,5 @@ public class RadialMenu
protected MouseHijacker _hijacker;
/** Maintains a list of action listeners. */
protected ObserverList<ActionListener> _actlist = ObserverList.createSafeInOrder();
protected ObserverList<ActionListener> _actlist = ObserverList.newSafeInOrder();
}
@@ -124,7 +124,7 @@ public class ObserverList<T> extends ArrayList<T>
* A convenience method for creating an observer list that avoids duplicating the type
* parameter on the right hand side.
*/
public static <T> ObserverList<T> createSafeInOrder ()
public static <T> ObserverList<T> newSafeInOrder ()
{
return new ObserverList<T>(SAFE_IN_ORDER_NOTIFY);
}
@@ -133,7 +133,7 @@ public class ObserverList<T> extends ArrayList<T>
* A convenience method for creating an observer list that avoids duplicating the type
* parameter on the right hand side.
*/
public static <T> ObserverList<T> createFastUnsafe ()
public static <T> ObserverList<T> newFastUnsafe ()
{
return new ObserverList<T>(FAST_UNSAFE_NOTIFY);
}
@@ -142,7 +142,7 @@ public class ObserverList<T> extends ArrayList<T>
* A convenience method for creating an observer list that avoids duplicating the type
* parameter on the right hand side.
*/
public static <T> ObserverList<T> create (int notifyPolicy, boolean allowDups)
public static <T> ObserverList<T> newList (int notifyPolicy, boolean allowDups)
{
return new ObserverList<T>(notifyPolicy, allowDups);
}
@@ -38,12 +38,11 @@ public class ObserverListTest extends TestCase
public void runTest ()
{
// Log.info("Testing safe list.");
ObserverList<TestObserver> list = ObserverList.createSafeInOrder();
testList(list);
ObserverList<TestObserver> list;
testList(list = ObserverList.newSafeInOrder());
// Log.info("Testing unsafe list.");
list = ObserverList.createFastUnsafe();
testList(list);
testList(list = ObserverList.newFastUnsafe());
}
public void testList (final ObserverList<TestObserver> list)