@Test public void testAdd() { BasicEventList<String> source = new BasicEventList<>(); EventList<String> firstLetters = GlazedLists.transformByFunction(source, GlazedListsTests.getFirstLetterFunction()); source.add(ZERO); source.add(ONE); source.add(0, TWO); assertEquals(3, firstLetters.size()); assertEquals("T", firstLetters.get(0)); assertEquals("Z", firstLetters.get(1)); assertEquals("O", firstLetters.get(2)); source.addAll(Arrays.asList("THREE", "FOUR")); assertEquals("T", firstLetters.get(3)); assertEquals("F", firstLetters.get(4)); }
@Override public E get(int index) { final S elem = source.get(index); return function.evaluate(elem); }
SimpleFunctionList extends TransformedList<S, E> { @Override public E get(int index) { final S elem = source.get(index); return function.evaluate(elem); } }
SimpleFunctionList extends TransformedList<S, E> { @Override public E get(int index) { final S elem = source.get(index); return function.evaluate(elem); } SimpleFunctionList(EventList<S> source, Function<S, E> function); }
SimpleFunctionList extends TransformedList<S, E> { @Override public E get(int index) { final S elem = source.get(index); return function.evaluate(elem); } SimpleFunctionList(EventList<S> source, Function<S, E> function); @Override E get(int index); @Override void listChanged(ListEvent<S> listChanges); }
SimpleFunctionList extends TransformedList<S, E> { @Override public E get(int index) { final S elem = source.get(index); return function.evaluate(elem); } SimpleFunctionList(EventList<S> source, Function<S, E> function); @Override E get(int index); @Override void listChanged(ListEvent<S> listChanges);  }