A healthy dash of google-collections

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5798 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Dave Hoover
2009-05-23 01:04:08 +00:00
parent 1bdb2cae16
commit b222eed2fd
34 changed files with 152 additions and 91 deletions
@@ -31,6 +31,9 @@ import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.samskivert.util.Collections;
import com.samskivert.util.HashIntMap;
import com.samskivert.util.ObserverList;
@@ -950,7 +953,7 @@ public class ChatDirector extends BasicDirector
*/
protected HashMap<String, CommandHandler> getCommandHandlers (String command)
{
HashMap<String, CommandHandler> matches = new HashMap<String, CommandHandler>();
HashMap<String, CommandHandler> matches = Maps.newHashMap();
BodyObject user = (BodyObject)_ctx.getClient().getClientObject();
for (Map.Entry<String, CommandHandler> entry : _handlers.entrySet()) {
String cmd = entry.getKey();
@@ -1436,11 +1439,10 @@ public class ChatDirector extends BasicDirector
protected DisplayMessageOp _displayMessageOp = new DisplayMessageOp();
/** Registered chat command handlers. */
protected static HashMap<String, CommandHandler> _handlers =
new HashMap<String, CommandHandler>();
protected static HashMap<String, CommandHandler> _handlers = Maps.newHashMap();
/** A history of chat commands. */
protected static ArrayList<String> _history = new ArrayList<String>();
protected static ArrayList<String> _history = Lists.newArrayList();
/** The maximum number of chatter usernames to track. */
protected static final int MAX_CHATTERS = 6;
@@ -23,6 +23,8 @@ package com.threerings.crowd.chat.client;
import java.util.HashSet;
import com.google.common.collect.Sets;
import com.samskivert.util.CollectionUtil;
import com.samskivert.util.ObserverList;
@@ -183,7 +185,7 @@ public class MuteDirector extends BasicDirector
protected ChatDirector _chatdir;
/** The mutelist. */
protected HashSet<Name> _mutelist = new HashSet<Name>();
protected HashSet<Name> _mutelist = Sets.newHashSet();
/** List of mutelist observers. */
protected ObserverList<MuteObserver> _observers =
@@ -25,6 +25,8 @@ import java.util.ArrayList;
import java.awt.event.ActionEvent;
import com.google.common.collect.Lists;
import com.samskivert.swing.Controller;
import com.threerings.crowd.data.PlaceConfig;
@@ -250,7 +252,7 @@ public abstract class PlaceController extends Controller
protected void addDelegate (PlaceControllerDelegate delegate)
{
if (_delegates == null) {
_delegates = new ArrayList<PlaceControllerDelegate>();
_delegates = Lists.newArrayList();
}
_delegates.add(delegate);
}