ubiware.core
Class Blackboard

java.lang.Object
  extended by ubiware.core.Blackboard
All Implemented Interfaces:
java.io.Serializable

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

Representation of the blackboard of an agent, the agent uses its blackboard to keep references to java objects. The blackboard works thread safe. 12.2.2010

Author:
Michael Cochez for UBIWARE project
See Also:
Serialized Form

Field Summary
(package private)  java.util.Map<ubiware.util.saplbuilder.Resource,java.lang.Object> blackboard
          The actual blackboard, mapping Strings (IDs) to Objects
(package private) static ubiware.util.IDGenerator idgenerator
          this object is kept for generating new IDs for objects put to the Blackboard
 
Constructor Summary
Blackboard()
           
 
Method Summary
 ubiware.util.saplbuilder.Resource addObject(java.lang.Object object)
          Add an object to the blackboard, the returned ID can be used later to retrieve the object from the Blackboard
 java.lang.Object getObject(ubiware.util.saplbuilder.Resource ID)
          get an object from the Blackboard if it exists there.
 java.lang.Object removeObject(ubiware.util.saplbuilder.Resource ID)
          remove an object from the Blackboard if it exists there.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blackboard

final java.util.Map<ubiware.util.saplbuilder.Resource,java.lang.Object> blackboard
The actual blackboard, mapping Strings (IDs) to Objects


idgenerator

static final ubiware.util.IDGenerator idgenerator
this object is kept for generating new IDs for objects put to the Blackboard

Constructor Detail

Blackboard

public Blackboard()
Method Detail

addObject

public ubiware.util.saplbuilder.Resource addObject(java.lang.Object object)
Add an object to the blackboard, the returned ID can be used later to retrieve the object from the Blackboard

Parameters:
object - The object which should be put on the Blackboard.
Returns:
The ID assigned to the object put on the Blackboard

removeObject

public java.lang.Object removeObject(ubiware.util.saplbuilder.Resource ID)
remove an object from the Blackboard if it exists there. If the object existed, it will be returned.

Parameters:
ID - The ID of the desired object.
Returns:
The Object of which removal is requested.

getObject

public java.lang.Object getObject(ubiware.util.saplbuilder.Resource ID)
get an object from the Blackboard if it exists there. Otherwise null will be returned.

Parameters:
ID - The ID of the desired object.
Returns:
The Object which is requested.