@Test public void testRemove() { CaseInsensitiveTreeMap<Integer> m = new CaseInsensitiveTreeMap<>(); m.put("a", 3); m.put("b", 0); assertEquals(3, (int)m.remove("a")); m.checkStructure(); assertEquals(1, m.size()); assertNull(m.get("a")); assertNull(m.get("A")); assertEquals(0, (int)m.remove("B")); m.checkStructure(); assertEquals(0, m.size()); assertNull(m.get("a")); assertNull(m.get("A")); assertNull(m.get("b")); assertNull(m.get("B")); }
public V remove(Object obj) { if (!(obj instanceof String)) return null; String lower = ((String)obj).toLowerCase(); String proper = caseConverter.get(lower); if (proper == null) return null; else { caseConverter.remove(lower); return data.remove(proper); } }
CaseInsensitiveTreeMap extends AbstractMap<String,V> { public V remove(Object obj) { if (!(obj instanceof String)) return null; String lower = ((String)obj).toLowerCase(); String proper = caseConverter.get(lower); if (proper == null) return null; else { caseConverter.remove(lower); return data.remove(proper); } } }
CaseInsensitiveTreeMap extends AbstractMap<String,V> { public V remove(Object obj) { if (!(obj instanceof String)) return null; String lower = ((String)obj).toLowerCase(); String proper = caseConverter.get(lower); if (proper == null) return null; else { caseConverter.remove(lower); return data.remove(proper); } } CaseInsensitiveTreeMap(); }
CaseInsensitiveTreeMap extends AbstractMap<String,V> { public V remove(Object obj) { if (!(obj instanceof String)) return null; String lower = ((String)obj).toLowerCase(); String proper = caseConverter.get(lower); if (proper == null) return null; else { caseConverter.remove(lower); return data.remove(proper); } } CaseInsensitiveTreeMap(); boolean containsKey(Object obj); V get(Object obj); V put(String key, V val); V remove(Object obj); Set<Map.Entry<String,V>> entrySet(); }
CaseInsensitiveTreeMap extends AbstractMap<String,V> { public V remove(Object obj) { if (!(obj instanceof String)) return null; String lower = ((String)obj).toLowerCase(); String proper = caseConverter.get(lower); if (proper == null) return null; else { caseConverter.remove(lower); return data.remove(proper); } } CaseInsensitiveTreeMap(); boolean containsKey(Object obj); V get(Object obj); V put(String key, V val); V remove(Object obj); Set<Map.Entry<String,V>> entrySet();  }