utils
Class BotCoordinationArtifact

java.lang.Object
  extended byutils.BotCoordinationArtifact
All Implemented Interfaces:
java.io.Serializable

public class BotCoordinationArtifact
extends java.lang.Object
implements java.io.Serializable

Simple coordination artifact for robot, based on help requests.

Author:
Francesco Baldisserri
See Also:
Serialized Form

Constructor Summary
BotCoordinationArtifact()
          Default constructor for BotCoordinationArtifact
 
Method Summary
 void addHelpRequest(java.lang.String name)
          Submit help request
 boolean checkRequest(java.lang.String rq)
          Checks that a served request it's still there
 boolean hasRequests()
          Tells if there are pending requests
 boolean removeRequest(java.lang.String rq)
          Remove any pending or served requests
 java.lang.String serveRequest()
          Ask for help request, if any.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BotCoordinationArtifact

public BotCoordinationArtifact()
Default constructor for BotCoordinationArtifact

Method Detail

addHelpRequest

public void addHelpRequest(java.lang.String name)
Submit help request

Parameters:
name - Bot name

serveRequest

public java.lang.String serveRequest()
Ask for help request, if any.

Returns:
Help request, if present.

hasRequests

public boolean hasRequests()
Tells if there are pending requests

Returns:
True if there are pending requests, false otherwise

removeRequest

public boolean removeRequest(java.lang.String rq)
Remove any pending or served requests

Parameters:
rq - Request
Returns:
Returns true if request was present, false otherwise.

checkRequest

public boolean checkRequest(java.lang.String rq)
Checks that a served request it's still there

Parameters:
rq - Request
Returns:
True if the requests it's still there, false otherwise.

toString

public java.lang.String toString()