@Test public void testReorder() { SortedList<Integer> source = new SortedList<>(new BasicEventList<Integer>(), null); FunctionList<Integer, String> intsToStrings = new FunctionList<>(source, new AdvancedIntegerToString(), new StringToInteger()); ListConsistencyListener consistencyListener = ListConsistencyListener.install(intsToStrings); source.add(ONE); source.add(ZERO); assertEquals(2, consistencyListener.getEventCount()); source.setComparator(GlazedLists.comparableComparator()); assertEquals(3, consistencyListener.getEventCount()); }
@Override public void add(int index, E value) { source.add(index, reverse(value)); }
FunctionList extends TransformedList<S, E> implements RandomAccess { @Override public void add(int index, E value) { source.add(index, reverse(value)); } }
FunctionList extends TransformedList<S, E> implements RandomAccess { @Override public void add(int index, E value) { source.add(index, reverse(value)); } FunctionList(EventList<S> source, Function<S,E> forward);  FunctionList(EventList<S> source, Function<S,E> forward, Function<E,S> reverse); }
FunctionList extends TransformedList<S, E> implements RandomAccess { @Override public void add(int index, E value) { source.add(index, reverse(value)); } FunctionList(EventList<S> source, Function<S,E> forward);  FunctionList(EventList<S> source, Function<S,E> forward, Function<E,S> reverse); void setForwardFunction(Function<S,E> forward); Function<S,E> getForwardFunction(); void setReverseFunction(Function<E,S> reverse); Function<E,S> getReverseFunction(); @Override void listChanged(ListEvent<S> listChanges); @Override E get(int index); @Override E remove(int index); @Override E set(int index, E value); @Override void add(int index, E value); @Override boolean removeIf(Predicate<? super E> filter); }
FunctionList extends TransformedList<S, E> implements RandomAccess { @Override public void add(int index, E value) { source.add(index, reverse(value)); } FunctionList(EventList<S> source, Function<S,E> forward);  FunctionList(EventList<S> source, Function<S,E> forward, Function<E,S> reverse); void setForwardFunction(Function<S,E> forward); Function<S,E> getForwardFunction(); void setReverseFunction(Function<E,S> reverse); Function<E,S> getReverseFunction(); @Override void listChanged(ListEvent<S> listChanges); @Override E get(int index); @Override E remove(int index); @Override E set(int index, E value); @Override void add(int index, E value); @Override boolean removeIf(Predicate<? super E> filter);  }