/** * If the counter of the key/value is greater than one, the counter is decreased. Otherwise, * the entry is removed and the value is cleaned up. */ public D remove(K key) { Count pair = content.get(key); if (pair == null) return null; if (pair.isLast()) { return removeAllOf(key); } return content.put(key, content.get(key).decrease()).getValue(); }
/** * If the counter of the key/value is greater than one, the counter is decreased. Otherwise, * the entry is removed and the value is cleaned up. */ public D remove(K key) { Count pair = content.get(key); if (pair == null) return null; if (pair.isLast()) { return removeAllOf(key); } return content.put(key, content.get(key).decrease()).getValue(); }
/** * Closes and discards the given Connection so that it can not be returned in subsequent calls * to attach(). This method is to be used when there is a problem with a Connection, e.g. socket * connection closed by remote host. */ public void discard(Connection c) { ConnectionData cd = connections.find(c); if (cd != null) connections.removeAllOf(cd); }
/** * Closes and discards all connections. */ public void discardAll() { for (ConnectionData cd : allConnections()) { connections.removeAllOf(cd); } }
/** * Closes and discards all connections. */ public void discardAll() { for (ConnectionData cd : allConnections()) { connections.removeAllOf(cd); } }
/** * Closes and discards the given Connection so that it can not be returned in subsequent calls * to attach(). This method is to be used when there is a problem with a Connection, e.g. socket * connection closed by remote host. */ public void discard(Connection c) { ConnectionData cd = connections.find(c); if (cd != null) connections.removeAllOf(cd); }