org.aitools.programd.bot
Class Bots

java.lang.Object
  extended by org.aitools.programd.bot.Bots

public class Bots
extends java.lang.Object

Contains all descriptions of bots.

Since:
4.1.5
Author:
Noel Bush

Field Summary
private  java.util.Map<java.lang.String,Bot> botMap
          The map of bot ids to bots.
 
Constructor Summary
Bots()
          Creates a new Bots.
 
Method Summary
 void addBot(java.lang.String botid, Bot bot)
          Adds the given bot with the given id.
 Bot getABot()
          Returns any bot (probably the last one loaded).
 Bot getBot(java.lang.String botid)
          Returns the bot with the given id.
 int getCount()
          Returns the number of bots (the size)
 java.util.Set<java.lang.String> getIDs()
          Returns the IDs (the key set)
 java.lang.String getNiceList()
          Returns a nicely-formatted list of the bots.
 boolean haveLoaded(java.lang.String filename)
          Returns whether any bots have loaded the given file(name).
 boolean include(java.lang.String botid)
          Returns whether the loaded bots include one with the given id.
 java.util.Iterator<java.lang.String> keysIterator()
          Returns an iterator over the key set
 void removeBot(java.lang.String id)
          Removes the indicated bot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

botMap

private java.util.Map<java.lang.String,Bot> botMap
The map of bot ids to bots.

Constructor Detail

Bots

public Bots()
Creates a new Bots.

Method Detail

include

public boolean include(java.lang.String botid)
Returns whether the loaded bots include one with the given id.

Parameters:
botid - the botid to look for
Returns:
whether the loaded bots include one with the given id

addBot

public void addBot(java.lang.String botid,
                   Bot bot)
Adds the given bot with the given id. No check is made to see whether a bot is already loaded with the given id!

Parameters:
botid - the id to use for the bot
bot - the bot to add

getBot

public Bot getBot(java.lang.String botid)
Returns the bot with the given id.

Parameters:
botid - the id of the bot to return
Returns:
the bot with the given id

getABot

public Bot getABot()
Returns any bot (probably the last one loaded).

Returns:
any bot (probably the last one loaded)

getCount

public int getCount()
Returns the number of bots (the size)

Returns:
the number of bots (the size)

getNiceList

public java.lang.String getNiceList()
Returns a nicely-formatted list of the bots.

Returns:
a nicely-formatted list of the bots

getIDs

public java.util.Set<java.lang.String> getIDs()
Returns the IDs (the key set)

Returns:
the IDs (the key set)

keysIterator

public java.util.Iterator<java.lang.String> keysIterator()
Returns an iterator over the key set

Returns:
an iterator over the key set

haveLoaded

public boolean haveLoaded(java.lang.String filename)
Returns whether any bots have loaded the given file(name).

Parameters:
filename -
Returns:
whether any bots have loaded the given file(name)

removeBot

public void removeBot(java.lang.String id)
Removes the indicated bot.

Parameters:
id -