@Test public void testHandleChange() { TransactionList<String> source = new TransactionList<>(new BasicEventList<String>()); FilterList<String> filtered = new FilterList<>(source); SeparatorList<String> separated = new SeparatorList<>(filtered, GlazedLists.comparableComparator(), 1, Integer.MAX_VALUE); ListConsistencyListener<String> listConsistencyListener = ListConsistencyListener.install(separated); listConsistencyListener.setPreviousElementTracked(false); source.addAll(GlazedListsTests.stringToList("AAA")); source.clear(); source.addAll(GlazedListsTests.stringToList("ABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCDEFFFFFFFFFGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHH")); filtered.setMatcher(new SubstringMatcher("BCDEFGH")); assertEquals(94, separated.size()); filtered.setMatcher(new SubstringMatcher("A")); assertEquals(2, separated.size()); filtered.setMatcher(new SubstringMatcher("ABCDEFGH")); assertEquals(96, separated.size()); filtered.setMatcher(new SubstringMatcher("AEFGH")); assertEquals(53, separated.size()); filtered.setMatcher(new SubstringMatcher("ABCDEFGH")); filtered.setMatcher(new SubstringMatcher("ABCDEFG")); filtered.setMatcher(new SubstringMatcher("ABCD")); assertEquals(45, separated.size()); filtered.setMatcher(new SubstringMatcher("BD")); assertEquals(36, separated.size()); filtered.setMatcher(Matchers.trueMatcher()); source.clear(); source.addAll(GlazedListsTests.stringToList("CCS")); source.beginEvent(); source.addAll(0, GlazedListsTests.stringToList("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDFNSSSSSSS")); source.remove(48); source.remove(48); source.addAll(49, GlazedListsTests.stringToList("STTTTTTTTTTTTTTTTTWWWWWWWWWWWWWWWWWWWW")); source.commitEvent(); source.clear(); source.addAll(0, GlazedListsTests.stringToList("CSC")); source.beginEvent(); source.addAll(0, GlazedListsTests.stringToList("WWWWCWWWWWWWWWWWWFSCCWSCTTTTCCSTTWTCSSCDTSWNSCCDDTCDCCDCTCTDCTCTCCCCCCWCCCCCC")); source.remove(77); source.remove(78); source.addAll(0, GlazedListsTests.stringToList("TSTTCCCCT")); source.commitEvent(); assertEqualsIgnoreSeparators(source, separated, GlazedLists.comparableComparator()); }
@Override public int size() { return collapsedElements.colourSize(Barcode.BLACK); }
SeparatorList extends TransformedList<E, E> { @Override public int size() { return collapsedElements.colourSize(Barcode.BLACK); } }
SeparatorList extends TransformedList<E, E> { @Override public int size() { return collapsedElements.colourSize(Barcode.BLACK); } SeparatorList(EventList<E> source, Comparator<? super E> comparator, int minimumSizeForSeparator, int defaultLimit); }
SeparatorList extends TransformedList<E, E> { @Override public int size() { return collapsedElements.colourSize(Barcode.BLACK); } SeparatorList(EventList<E> source, Comparator<? super E> comparator, int minimumSizeForSeparator, int defaultLimit); @Override int size(); void setComparator(Comparator<E> comparator); @Override void listChanged(ListEvent<E> listChanges); @Override void dispose(); }
SeparatorList extends TransformedList<E, E> { @Override public int size() { return collapsedElements.colourSize(Barcode.BLACK); } SeparatorList(EventList<E> source, Comparator<? super E> comparator, int minimumSizeForSeparator, int defaultLimit); @Override int size(); void setComparator(Comparator<E> comparator); @Override void listChanged(ListEvent<E> listChanges); @Override void dispose();  }