MCPcopy Create free account
hub / github.com/GateNLP/gate-core / put

Method put

src/main/java/gate/util/OptionsMap.java:42–53  ·  view source on GitHub ↗

Converts the value to string using Strings#toString(Object) method and then stores it. There is get methods for values that are a String, an Integer, a Boolean, a Font, a List of String and a Map of String String.

(Object key, Object value)

Source from the content-addressed store, hash-verified

40 * a Font, a List of String and a Map of String*String.
41 */
42 @Override
43 public Object put(Object key, Object value) {
44 if(value instanceof Font){
45 Font font = (Font)value;
46 String family = font.getFamily();
47 int size = font.getSize();
48 boolean italic = font.isItalic();
49 boolean bold = font.isBold();
50 value = family + "#" + size + "#" + italic + "#" + bold;
51 }
52 return super.put(key.toString(), Strings.toString(value));
53 }
54
55 public Object put(Object key, LinkedHashSet<String> value) {
56 return super.put(key.toString(), Strings.toString(value));

Callers 4

testConfigUpdatingMethod · 0.95
runMethod · 0.95
getFontMethod · 0.45
getStringMapMethod · 0.45

Calls 3

toStringMethod · 0.95
toStringMethod · 0.65
getSizeMethod · 0.45

Tested by 1

testConfigUpdatingMethod · 0.76