agentland.rufus
Class ConfuciusAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--agentland.util.GoodAgent
                                |
                                +--agentland.rufus.ConfuciusAgent
All Implemented Interfaces:
Agent, Confucius, Good, MetagluePrimitives, Remote, Serializable, Spy

public class ConfuciusAgent
extends GoodAgent
implements Confucius

This agent can be used to get a random saying whenever desired. New sayings can be stored at any time. With a better sql interface we could make cool lookups (for features such as length and content) for these sayings. Also would be nice to have a big saying agent which uses a bunch of little ones, and Unix fortune, etc.

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Field Summary
static String CONFUCIUS_CONFUSED
           
static String CONFUCIUS_EMPTY
           
 
Fields inherited from class agentland.util.GoodAgent
alert, notifier
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
ConfuciusAgent()
           
 
Method Summary
 void addSaying(String saying)
           
 String getSaying()
           
 String getSayingNumber(int i)
           
 void listSayings()
          Print to console.
 int numSayings()
           
 void setSaying(int ind, String saying)
           
 void useSayingBase(String mapname)
          Use the saying database that the Conf.
 
Methods inherited from class agentland.util.GoodAgent
addSpy, addSpy, alert, alertString, beep, error, getAlert, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName, tell
 
Methods inherited from class metaglue.AgentAgent
addMonitor, alive, buildEHAFor, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getOldLogs, getProperties, getProxyHandlerClass, getSociety, installAPH, log, log, lookupClass, reliesOn, reliesOn, reliesOn, reliesOnSynch, removeAPHFromCatalog, removeFrozen, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, toString, whereAreYou
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface agentland.util.Good
getHistory, getHistoryElement, resetHistory
 
Methods inherited from interface metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, getOldLogs, shutdown, startup, whereAreYou
 
Methods inherited from interface agentland.util.Spy
tell
 

Field Detail

CONFUCIUS_EMPTY

public static String CONFUCIUS_EMPTY

CONFUCIUS_CONFUSED

public static String CONFUCIUS_CONFUSED
Constructor Detail

ConfuciusAgent

public ConfuciusAgent()
               throws RemoteException
Method Detail

useSayingBase

public void useSayingBase(String mapname)
Description copied from interface: Confucius
Use the saying database that the Conf. Agent of the given designation mapname would use.
Specified by:
useSayingBase in interface Confucius

addSaying

public void addSaying(String saying)
               throws RemoteException
Specified by:
addSaying in interface Confucius

setSaying

public void setSaying(int ind,
                      String saying)
               throws RemoteException
Specified by:
setSaying in interface Confucius

getSaying

public String getSaying()
                 throws RemoteException
Specified by:
getSaying in interface Confucius

numSayings

public int numSayings()
               throws RemoteException
Specified by:
numSayings in interface Confucius

getSayingNumber

public String getSayingNumber(int i)
Specified by:
getSayingNumber in interface Confucius

listSayings

public void listSayings()
                 throws RemoteException
Description copied from interface: Confucius
Print to console.
Specified by:
listSayings in interface Confucius