public Builder removeSymbolStatistics(Symbol symbol) { symbolStatistics = symbolStatistics.minus(symbol); return this; }
public MapPSet<E> minus(final Object e) { if(!contains(e)) return this; return new MapPSet<E>(map.minus(e)); }
public MapPSet<E> minus(final Object e) { if(!contains(e)) return this; return new MapPSet<E>(map.minus(e)); }
public HashPMap<K,V> minus(final Object key) { PSequence<Entry<K,V>> entries = getEntries(key.hashCode()); int i = keyIndexIn(entries, key); if(i==-1) // key not in this return this; entries = entries.minus(i); if(entries.size()==0) // get rid of the entire hash entry return new HashPMap<K,V>(intMap.minus(key.hashCode()), size-1); // otherwise replace hash entry with new smaller one: return new HashPMap<K,V>(intMap.plus(key.hashCode(), entries), size-1); }
public HashPMap<K,V> minus(final Object key) { PSequence<Entry<K,V>> entries = getEntries(key.hashCode()); int i = keyIndexIn(entries, key); if(i==-1) // key not in this return this; entries = entries.minus(i); if(entries.size()==0) // get rid of the entire hash entry return new HashPMap<K,V>(intMap.minus(key.hashCode()), size-1); // otherwise replace hash entry with new smaller one: return new HashPMap<K,V>(intMap.plus(key.hashCode(), entries), size-1); }
@SuppressWarnings("unchecked") public MapPBag<E> minus(final Object e) { int n = count(e); if(n==0) return this; if(n==1) // remove from map return new MapPBag<E>(map.minus(e), size-1); // otherwise just decrement count: return new MapPBag<E>(map.plus((E)e, n-1), size-1); }
@SuppressWarnings("unchecked") public MapPBag<E> minus(final Object e) { int n = count(e); if(n==0) return this; if(n==1) // remove from map return new MapPBag<E>(map.minus(e), size-1); // otherwise just decrement count: return new MapPBag<E>(map.plus((E)e, n-1), size-1); }
public Builder removeSymbolStatistics(Symbol symbol) { symbolStatistics = symbolStatistics.minus(symbol); return this; }
public Scopes remove(UUID scopeId) { if (scopeId == currentId) { throw new IllegalArgumentException("Can't remove the current scope: " + scopeId); } return new Scopes(currentId, scopes.minus(scopeId)); }
/** * @param key * @return * @see org.pcollections.PMap#minus(java.lang.Object) */ @Override public PersistentMapX<K, V> minus(final Object key) { return withMap(map.minus(key)); }
public void testMap() { PMap<Object,String> m = HashTreePMap.<Object,String>empty(); assertEquals(m.size(),0); m = m.plus(1,"One"); assertEquals(m.get(1),"One"); // last three have same hashCode: Object[] keys = {1,2,0,3,ConsPStack.empty()}; String[] values = {"one","two","","three","emptyList"}; for(int i=0;i<keys.length;i++) { m = m.plus(keys[i],values[i]); m = m.minus(keys[i]); m = m.plus(keys[i],values[i]); assertEquals(m.size(),i+1); assertEquals(m.get(keys[i]),values[i]); } for(int i=keys.length-1;i>=0;i--) { m = m.minus(keys[i]); assertEquals(m.size(),i); } }
public Events removeEvent(UUID scopeId, UUID eventId) { PMap<UUID, EventRecord> scope = this.events.get(scopeId); if (scope == null) { throw new IllegalArgumentException("Scope not found: " + scopeId); } scope = scope.minus(eventId); if (scope.isEmpty()) { return new Events(this.events.minus(scopeId)); } else { return new Events(this.events.plus(scopeId, scope)); } }
private void mergeProxies(Class key,PSet<ProxyWrapper> proxies){ val current = proxyCache.get(key); proxyCache.minus(key); val newProxies = current==null ? proxies : proxies.plusAll(current); proxyCache = proxyCache.plus(key, newProxies); }
private PSet<ProxyWrapper> removeProxies(Class key){ val proxies = proxyCache.get(key); val proxiesToUse = proxies==null ? HashTreePSet.singleton(new ProxyWrapper((Proxy)Proxy.newProxyInstance(InvokeDynamicComprehender.class.getClassLoader(), new Class[]{key},new FunctionExecutionInvocationHandler()))) : proxies; if(proxies!=null) proxyCache = proxyCache.minus(key); return proxiesToUse; } private void mergeProxies(Class key,PSet<ProxyWrapper> proxies){
private PSet<ProxyWrapper> removeProxies(Class key){ val proxies = proxyCache.get(key); val proxiesToUse = proxies==null ? HashTreePSet.singleton(new ProxyWrapper((Proxy)Proxy.newProxyInstance(InvokeDynamicComprehender.class.getClassLoader(), new Class[]{key},new FunctionExecutionInvocationHandler()))) : proxies; if(proxies!=null) proxyCache = proxyCache.minus(key); return proxiesToUse; } private void mergeProxies(Class key,PSet<ProxyWrapper> proxies){
private void mergeProxies(Class key,PSet<ProxyWrapper> proxies){ val current = proxyCache.get(key); proxyCache.minus(key); val newProxies = current==null ? proxies : proxies.plusAll(current); proxyCache = proxyCache.plus(key, newProxies); }
private synchronized void mergeProxies(Class key,PSet<ProxyWrapper> proxies){ val current = proxyCache.get(key); proxyCache.minus(key); val newProxies = current==null ? proxies : proxies.plusAll(current); proxyCache = proxyCache.plus(key, newProxies); }
private void mergeProxies(Class key,PSet<ProxyWrapper> proxies){ val current = proxyCache.get(key); proxyCache.minus(key); val newProxies = current==null ? proxies : proxies.plusAll(current); proxyCache = proxyCache.plus(key, newProxies); }