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

Method set

PCGen-base/code/src/java/pcgen/base/util/MappedDeque.java:135–143  ·  view source on GitHub ↗

Sets a new value onto the Deque for the given TypedKey. This is effectively a shortcut for calling pop(key) followed by push(key, value). This has the same effects as pop of not throwing an error if the Deque is currently empty. @param key The TypeKey for which the given value should be

(TypedKey<T> key, T value)

Source from the content-addressed store, hash-verified

133 * Deque
134 */
135 public <T> void set(TypedKey<T> key, T value)
136 {
137 Deque<Object> dq = getDeque(Objects.requireNonNull(key));
138 if (!dq.isEmpty())
139 {
140 dq.pop();
141 }
142 dq.push(wrap(value));
143 }
144
145 /**
146 * Returns a Deque for the given TypedKey, building and storing it if the

Callers 3

testNonNullKeyMethod · 0.95
testSetMethod · 0.95
testPopMethod · 0.95

Calls 5

getDequeMethod · 0.95
wrapMethod · 0.95
popMethod · 0.80
pushMethod · 0.80
isEmptyMethod · 0.65

Tested by 3

testNonNullKeyMethod · 0.76
testSetMethod · 0.76
testPopMethod · 0.76