void initCommandMap ()
  {
    commandMap = new TreeMap();
    
    commandMap.put(new IrcString("PING"), 
        new commandDefinition(2)
        { public void action ( IrcCommand c, IrcEventListener l )
          { l.onPing( c.getArg(1).toString());
          }
        });
    commandMap.put(new IrcString("422"), 
        new commandDefinition(1)
        { public void action ( IrcCommand c, IrcEventListener l )
          { l.onNoMotd();
          }
        });
    commandMap.put(new IrcString("376"), 
        new commandDefinition(1)
        { public void action ( IrcCommand c, IrcEventListener l )
          { l.onMotdEnd();
          }
        });
    commandMap.put(new IrcString("JOIN"),
        new commandDefinition(2)
        { public void action ( IrcCommand c, IrcEventListener l )
          { if(c.prefix != null)
              l.onJoin(c.prefix, c.getArg(1));
          }
        });
    commandMap.put(new IrcString("PRIVMSG"),
        new commandDefinition(3)
        { public void action ( IrcCommand c, IrcEventListener l )
          { if(c.prefix != null)
              l.onPrivMsg(c.prefix, c.getArg(1), c.getArg(2).toString());
          }
        });
    commandMap.put(new IrcString("PART"),
        new commandDefinition(2)
        { public void action ( IrcCommand c, IrcEventListener l )
          { if(c.prefix != null)
              l.onPart(c.prefix, c.getArg(1));
          }
        });
    commandMap.put(new IrcString("NICK"),
        new commandDefinition(2)
        { public void action ( IrcCommand c, IrcEventListener l )
          { if(c.prefix != null)
              l.onNick(c.prefix, c.getArg(1));
          }
        });
    commandMap.put(new IrcString("QUIT"),
        new commandDefinition(1)
        { public void action ( IrcCommand c, IrcEventListener l )
          { if(c.prefix == null)
              return;
            if(c.args.size() > 1)
              l.onQuit(c.prefix, c.getArg(1).toString());
            else
              l.onQuit(c.prefix, "");
          }
        });
    commandMap.put(new IrcString("353"),  /* eg. :irc.phobos 353 kingping = #q3mods :kingping */
        new commandDefinition(5)          /*                  0     1     2    3        4     */
        { public void action ( IrcCommand c, IrcEventListener l )
          { if(c.prefix != null)
              l.onNamesList(c.getArg(3), c.getArg(4));
          }
        });
    commandMap.put(new IrcString("001"), /* Documented in RFC 2812 */
        new commandDefinition(3)
        { public void action ( IrcCommand c, IrcEventListener l )
          { l.onWelcome( c.getArg(1), c.getArg(2).toString() );
          }
        });
    commandMap.put(new IrcString("MODE"),
        new commandDefinition(3)
        { public void action ( IrcCommand c, IrcEventListener l )
          { Vector args = new Vector ( c.args );
            // Take off the command, channel/target, and modes
            args.remove(0);
            args.remove(0);
            args.remove(0);
            l.onMode( c.prefix, c.getArg(1), c.getArg(2), args );
          }
        });
    commandMap.put(new IrcString("TOPIC"),
        new commandDefinition(2)
        { public void action ( IrcCommand c, IrcEventListener l )
          { if(c.prefix != null)
            { String topic;
              if(c.args.size() >= 3)
                topic = c.getArg(2).toString();
              else
                topic = "";
              l.onTopicChange( c.prefix, c.getArg(1), topic );
            }
          }
        });
    commandMap.put(new IrcString("332"),
        new commandDefinition(4)
        { public void action ( IrcCommand c, IrcEventListener l )
          { l.onTopic( c.getArg(2), c.getArg(3).toString() );
          }
        });
    commandMap.put(new IrcString("331"),
        new commandDefinition(3)
        { public void action ( IrcCommand c, IrcEventListener l )
          { l.onNoTopic( c.getArg(2) );
          }
        });
  }