@Override public V put(final V8Value key, final V value) { this.remove(key); V8Value twin = key.twin(); twinMap.put(twin, twin); return map.put(twin, value); }
/** * Removes the executor from this runtime. The executor is * *NOT* shutdown, simply removed from the list of known * executors. * * @param key The key the executor was associated with. * @return The executor or null if it does not exist. */ public V8Executor removeExecutor(final V8Object key) { checkThread(); if (executors == null) { return null; } return executors.remove(key); }
@Override public V put(final V8Value key, final V value) { this.remove(key); V8Value twin = key.twin(); twinMap.put(twin, twin); return map.put(twin, value); }
/** * Removes the executor from this runtime. The executor is * *NOT* shutdown, simply removed from the list of known * executors. * * @param key The key the executor was associated with. * @return The executor or null if it does not exist. */ public V8Executor removeExecutor(final V8Object key) { checkThread(); if (executors == null) { return null; } return executors.remove(key); }
@Test public void testRemoveKeyReleasesKey() { V8Map<String> map = new V8Map<String>(); v8.executeScript("var x = {}"); V8Object v8Object = v8.getObject("x"); map.put(v8Object, "foo"); map.remove(v8Object); v8Object.close(); map.close(); }
@Test public void testRemoveMissing() { V8Map<String> map = new V8Map<String>(); v8.executeVoidScript("var x = {}"); V8Object v8Object = v8.getObject("x"); assertNull(map.remove(v8Object)); v8Object.close(); map.close(); }
@Test public void testRemove() { V8Map<String> map = new V8Map<String>(); v8.executeVoidScript("var x = {}"); V8Object v8Object = v8.getObject("x"); map.put(v8Object, "foo"); assertEquals("foo", map.remove(v8Object)); v8Object.close(); map.close(); }
@Override public V put(final V8Value key, final V value) { this.remove(key); V8Value twin = key.twin(); twinMap.put(twin, twin); return map.put(twin, value); }
@Override public V put(final V8Value key, final V value) { this.remove(key); V8Value twin = key.twin(); twinMap.put(twin, twin); return map.put(twin, value); }
/** * Removes the executor from this runtime. The executor is * *NOT* shutdown, simply removed from the list of known * executors. * * @param key The key the executor was associated with. * @return The executor or null if it does not exist. */ public V8Executor removeExecutor(final V8Object key) { checkThread(); if (executors == null) { return null; } return executors.remove(key); }
/** * Removes the executor from this runtime. The executor is * *NOT* shutdown, simply removed from the list of known * executors. * * @param key The key the executor was associated with. * @return The executor or null if it does not exist. */ public V8Executor removeExecutor(final V8Object key) { checkThread(); if (executors == null) { return null; } return executors.remove(key); }