MCPcopy Create free account
hub / github.com/PCGen/pcgen / get

Method get

PCGen-base/code/src/java/pcgen/base/util/DefaultMap.java:45–53  ·  view source on GitHub ↗

Gets the value mapped to a given key if there is a value for the key in the Map. Otherwise, returns the default value.

(Object key)

Source from the content-addressed store, hash-verified

43 * the Map. Otherwise, returns the default value.
44 */
45 @Override
46 public V get(Object key)
47 {
48 /*
49 * Please note this cannot be done as a get and a test for null, because
50 * null is a valid map if the key is actually contained within the Map.
51 */
52 return containsKey(key) ? super.get(key) : defaultValue;
53 }
54
55 /**
56 * Returns the default value (what is returned by the get method if a key is

Callers 2

testPutGetExactMethod · 0.95

Calls 2

containsKeyMethod · 0.65
getMethod · 0.65

Tested by 2

testPutGetExactMethod · 0.76