Package com.vividsolutions.jump.util
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Blackboard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Blackboardclone()Warning : does not follow the clone contract (does not call super.clone()) but uses a copy consructor instead.Objectget(String key)booleanget(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.doubleget(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.intget(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.Objectget(String key, Object defaultValue)booleangetBoolean(String key)Use getBoolean if you know that the value stored for key is an integer.doublegetDouble(String key)Use getDouble if you know that the value stored for key is a double.intgetInt(String key)Use getInt if you know that the value stored for key is an integer.HashMap<String,Object>getProperties()Used by Java2XMLBlackboardput(String key, boolean value)Blackboardput(String key, double value)Blackboardput(String key, int value)Blackboardput(String key, Object value)BlackboardputAll(Map<String,Object> properties)Objectremove(String key)voidsetProperties(HashMap<String,Object> properties)Used by Java2XML
-
-
-
Method Detail
-
put
public Blackboard put(String key, Object value)
-
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 retrievedefaultValue- 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)
-
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 retrievedefaultValue- 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 retrievedefaultValue- 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
-
clone
public Blackboard clone()
Warning : does not follow the clone contract (does not call super.clone()) but uses a copy consructor instead.
-
-