@Test public void testGet() { final EventList<String> source = new BasicEventList<>(); final Map<String, String> eventMap = GlazedLists.syncEventListToMap(source, new FirstLetterFunction()); source.add("James"); assertEquals(1, eventMap.size()); assertEquals("James", eventMap.get("J")); source.add("Lemieux"); assertEquals(2, eventMap.size()); assertEquals("James", eventMap.get("J")); assertEquals("Lemieux", eventMap.get("L")); assertEquals(null, eventMap.get("W")); source.addAll(GlazedListsTests.delimitedStringToList("Holger Brands")); assertEquals(4, eventMap.size()); assertEquals("James", eventMap.get("J")); assertEquals("Lemieux", eventMap.get("L")); assertEquals("Holger", eventMap.get("H")); assertEquals("Brands", eventMap.get("B")); source.remove("Lemieux"); assertEquals(3, eventMap.size()); assertEquals("James", eventMap.get("J")); assertEquals(null, eventMap.get("L")); assertEquals("Holger", eventMap.get("H")); assertEquals("Brands", eventMap.get("B")); source.remove("James"); assertEquals(2, eventMap.size()); assertEquals(null, eventMap.get("J")); assertEquals(null, eventMap.get("L")); assertEquals("Holger", eventMap.get("H")); assertEquals("Brands", eventMap.get("B")); source.set(0, "Andy"); assertEquals("Andy", eventMap.get("A")); assertEquals(null, eventMap.get("H")); assertEquals("Brands", eventMap.get("B")); source.clear(); assertEquals(0, eventMap.size()); assertEquals(null, eventMap.get("J")); assertEquals(null, eventMap.get("L")); assertEquals(null, eventMap.get("H")); assertEquals(null, eventMap.get("B")); assertTrue(eventMap.isEmpty()); try { source.addAll(GlazedListsTests.delimitedStringToList("Bobby Boucher")); fail("Failed to receive an IllegalStateException when violating the single key uniqueness constraint"); } catch (IllegalStateException e) { } }
@Override public V get(Object key) { return delegate.get(key); }
FunctionListMap implements DisposableMap<K, V> { @Override public V get(Object key) { return delegate.get(key); } }
FunctionListMap implements DisposableMap<K, V> { @Override public V get(Object key) { return delegate.get(key); } FunctionListMap(EventList<V> source, FunctionList.Function<V, K> keyFunction); }
FunctionListMap implements DisposableMap<K, V> { @Override public V get(Object key) { return delegate.get(key); } FunctionListMap(EventList<V> source, FunctionList.Function<V, K> keyFunction); @Override void dispose(); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override V get(Object key); @Override V put(K key, V value); @Override void putAll(Map<? extends K, ? extends V> m); @Override void clear(); @Override V remove(Object key); @Override Collection<V> values(); @Override Set<K> keySet(); @Override Set<Entry<K, V>> entrySet(); @Override void forEach(BiConsumer<? super K, ? super V> action); @Override boolean equals(Object o); @Override int hashCode(); }
FunctionListMap implements DisposableMap<K, V> { @Override public V get(Object key) { return delegate.get(key); } FunctionListMap(EventList<V> source, FunctionList.Function<V, K> keyFunction); @Override void dispose(); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override V get(Object key); @Override V put(K key, V value); @Override void putAll(Map<? extends K, ? extends V> m); @Override void clear(); @Override V remove(Object key); @Override Collection<V> values(); @Override Set<K> keySet(); @Override Set<Entry<K, V>> entrySet(); @Override void forEach(BiConsumer<? super K, ? super V> action); @Override boolean equals(Object o); @Override int hashCode();  }