@Test public void testValues() { final EventList<String> source = new BasicEventList<>(); final Map<String, String> eventMap = GlazedLists.syncEventListToMap(source, new FirstLetterFunction()); assertTrue(eventMap.values().isEmpty()); source.addAll(GlazedListsTests.delimitedStringToList("Jesse Wilson Holger Brands")); assertEquals(4, eventMap.values().size()); assertEquals("Jesse", eventMap.get("J")); assertEquals("Wilson", eventMap.get("W")); assertEquals("Holger", eventMap.get("H")); assertEquals("Brands", eventMap.get("B")); eventMap.values().add("Andy"); eventMap.values().add("Depue"); assertEquals(6, eventMap.size()); assertEquals("Jesse", eventMap.get("J")); assertEquals("Wilson", eventMap.get("W")); assertEquals("Holger", eventMap.get("H")); assertEquals("Brands", eventMap.get("B")); assertEquals("Andy", eventMap.get("A")); assertEquals("Depue", eventMap.get("D")); eventMap.values().remove("Jesse"); eventMap.values().remove("Wilson"); assertEquals(4, eventMap.size()); assertEquals(null, eventMap.get("J")); assertEquals(null, eventMap.get("W")); assertEquals("Holger", eventMap.get("H")); assertEquals("Brands", eventMap.get("B")); assertEquals("Andy", eventMap.get("A")); assertEquals("Depue", eventMap.get("D")); assertTrue(eventMap.values().contains("Holger")); assertTrue(eventMap.values().contains("Brands")); assertTrue(eventMap.values().contains("Andy")); assertTrue(eventMap.values().contains("Depue")); }
@Override public Collection<V> values() { return valueList; }
FunctionListMap implements DisposableMap<K, V> { @Override public Collection<V> values() { return valueList; } }
FunctionListMap implements DisposableMap<K, V> { @Override public Collection<V> values() { return valueList; } FunctionListMap(EventList<V> source, FunctionList.Function<V, K> keyFunction); }
FunctionListMap implements DisposableMap<K, V> { @Override public Collection<V> values() { return valueList; } 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 Collection<V> values() { return valueList; } 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();  }