net.refractions.udig.project
Interface IBlackboard

All Known Subinterfaces:
IStyleBlackboard

public interface IBlackboard

Provide Temporary for shared collaboration between renderers and the user.

To emphais the tempoary nature we are not storing objects at this time, please see StyleBlackboard for the direction we wish to take this class. API should this interface be included?

Q: Should this class be cloneable? API explain the use of 'keys' and any uniqueness constraints (Set or List?) API X getX(key) ... should this be X get(key) and let the compiler firgure out which one to call based on the signature? API moreover, you might want to consider on 'Objects' and the use of in the API, using generics to avoid multiple get and put methods. API looks alot like a Map ... either document a comparison or add an extends clause?

Since:
0.7.0
Author:
Jody Garnett

Method Summary
 void addAll(IBlackboard blackboard)
          adds all the contents of the source blackboard to the destination blackboard
 boolean addListener(IBlackboardListener listener)
          Adds a listener to the blackboard.
 void clear()
          Clear the contents of this blackboard.
 boolean contains(java.lang.String key)
          Check if blackboard has an entry for key.
 void flush()
          Flush the contents of this blackboard.
 java.lang.Object get(java.lang.String key)
          Returns the object value of the given key.
 java.lang.Float getFloat(java.lang.String key)
          Returns the floating point value of the given key.
 java.lang.Integer getInteger(java.lang.String key)
          Returns the integer value of the given key.
 java.lang.String getString(java.lang.String key)
          Returns the string value of the given key.
 java.util.Set<java.lang.String> keySet()
          return the set of keys on the blackboard.
 void put(java.lang.String key, java.lang.Object value)
          Sets the value of the given key.
 void putFloat(java.lang.String key, float value)
          Sets the value of the given key to the given floating point number.
 void putInteger(java.lang.String key, int value)
          Sets the value of the given key to the given integer.
 void putString(java.lang.String key, java.lang.String value)
          Sets the value of the given key to the given string.
 boolean removeListener(IBlackboardListener listener)
          Removes a listener
 

Method Detail

addListener

boolean addListener(IBlackboardListener listener)
Adds a listener to the blackboard. Duplicates are not permitted.

Parameters:
listener - a listener that will be notified when the blackboard changes
Returns:
true if the collection changed as a result of the call.

removeListener

boolean removeListener(IBlackboardListener listener)
Removes a listener

Parameters:
listener - the listener to be removed.
Returns:
true if the collection contained the specified element.

contains

boolean contains(java.lang.String key)
Check if blackboard has an entry for key.

Returns:
true if a value is known for key

get

java.lang.Object get(java.lang.String key)
Returns the object value of the given key.

Parameters:
key - the key
Returns:
the value, or null if the key was not found

put

void put(java.lang.String key,
         java.lang.Object value)
Sets the value of the given key.

Parameters:
key - the key
value - the value

getFloat

java.lang.Float getFloat(java.lang.String key)
Returns the floating point value of the given key.

Parameters:
key - the key
Returns:
the value, or null if the key was not found or was found but was not a floating point number

getInteger

java.lang.Integer getInteger(java.lang.String key)
Returns the integer value of the given key.

Parameters:
key - the key
Returns:
the value, or null if the key was not found or was found but was not an integer

getString

java.lang.String getString(java.lang.String key)
Returns the string value of the given key.

Parameters:
key - the key
Returns:
the value, or null if the key was not found

putFloat

void putFloat(java.lang.String key,
              float value)
Sets the value of the given key to the given floating point number.

Parameters:
key - the key
value - the value

putInteger

void putInteger(java.lang.String key,
                int value)
Sets the value of the given key to the given integer.

Parameters:
key - the key
value - the value

putString

void putString(java.lang.String key,
               java.lang.String value)
Sets the value of the given key to the given string.

Parameters:
key - the key
value - the value

clear

void clear()
Clear the contents of this blackboard.

This is a clear() method, not a dispose(), resource handling is not provided.

It is not recommend that client code store *real* (such as Images) resources on the blackboard. This is not a ImageCache that will magically handle resource management for you.


flush

void flush()
Flush the contents of this blackboard.

This signals the blackboard to save any contents, and clear any cached object references.


addAll

void addAll(IBlackboard blackboard)
adds all the contents of the source blackboard to the destination blackboard

Parameters:
blackboard -

keySet

java.util.Set<java.lang.String> keySet()
return the set of keys on the blackboard.

Returns: