Class Blackboard

java.lang.Object
com.vividsolutions.jump.util.Blackboard
All Implemented Interfaces:
Serializable, Cloneable

public class Blackboard extends Object implements Cloneable, Serializable
String-to-Object map that anyone can use. For example, the Options dialog has a single instance, and it's stored on the Workbench Blackboard.
See Also:
  • Constructor Details

    • Blackboard

      public Blackboard()
  • Method Details

    • getProperties

      public HashMap<String,Object> getProperties()
      Used by Java2XML
    • setProperties

      public void setProperties(HashMap<String,Object> properties)
      Used by Java2XML
    • put

      public Blackboard put(String key, Object value)
    • get

      public Object get(String key)
    • put

      public Blackboard put(String key, boolean value)
    • putAll

      public Blackboard putAll(Map<String,Object> properties)
    • get

      public boolean get(String key, boolean defaultValue)
      If no value is yet defined for this key, map default value to the key in the blackboard and return it.
      Parameters:
      key - key of the value to retrieve
      defaultValue - default boolean value for this key
      Returns:
      the value associated to the key or defaultValue if no value is yet defined for the key
    • getBoolean

      public boolean getBoolean(String key)
      Use getBoolean if you know that the value stored for key is an integer.
      Parameters:
      key - key of the value to retrieve
      Returns:
      the boolean value associated with this key
    • put

      public Blackboard put(String key, int value)
    • put

      public Blackboard put(String key, double value)
    • remove

      public Object remove(String key)
    • get

      public double get(String key, double defaultValue)
      If no value is yet defined for this key, map default value to the key in the blackboard and return it.
      Parameters:
      key - key of the value to retrieve
      defaultValue - default double value for this key
      Returns:
      the value associated to the key or defaultValue if no value is yet defined for the key
    • get

      public int get(String key, int defaultValue)
      If no value is yet defined for this key, map default value to the key in the blackboard and return it.
      Parameters:
      key - key of the value to retrieve
      defaultValue - default integer value for this key
      Returns:
      the value associated to the key or defaultValue if no value is yet defined for the key
    • getInt

      public int getInt(String key)
      Use getInt if you know that the value stored for key is an integer.
      Parameters:
      key - key of the value to retrieve
      Returns:
      the integer value associated with this key
    • getDouble

      public double getDouble(String key)
      Use getDouble if you know that the value stored for key is a double.
      Parameters:
      key - key of the value to retrieve
      Returns:
      the double value associated with this key
    • get

      public Object get(String key, Object defaultValue)
    • clone

      public Blackboard clone()
      Warning : does not follow the clone contract (does not call super.clone()) but uses a copy consructor instead.
      Overrides:
      clone in class Object
      Returns:
      a new Blackboard containing the same properties