@Test public void testLimit() { EventList<String> source = SortedList.create(new BasicEventList<String>()); source.addAll(GlazedListsTests.stringToList("AAAAAAABBCCCCC")); SeparatorList<String> separatorList = new SeparatorList<>(source, GlazedLists.comparableComparator(), 0, 3); ListConsistencyListener<String> listConsistencyListener = ListConsistencyListener.install(separatorList); listConsistencyListener.setPreviousElementTracked(false); assertSeparatorEquals(separatorList.get(0), 7, "A"); assertEquals("A", separatorList.get(1)); assertEquals("A", separatorList.get(2)); assertEquals("A", separatorList.get(3)); assertSeparatorEquals(separatorList.get(4), 2, "B"); assertEquals("B", separatorList.get(5)); assertEquals("B", separatorList.get(6)); assertSeparatorEquals(separatorList.get(7), 5, "C"); assertEquals("C", separatorList.get(8)); assertEquals("C", separatorList.get(9)); assertEquals("C", separatorList.get(10)); assertEquals(11, separatorList.size()); source.addAll(GlazedListsTests.stringToList("ABBB")); assertSeparatorEquals(separatorList.get(0), 8, "A"); assertEquals("A", separatorList.get(1)); assertEquals("A", separatorList.get(2)); assertEquals("A", separatorList.get(3)); assertSeparatorEquals(separatorList.get(4), 5, "B"); assertEquals("B", separatorList.get(5)); assertEquals("B", separatorList.get(6)); assertEquals("B", separatorList.get(7)); assertSeparatorEquals(separatorList.get(8), 5, "C"); assertEquals("C", separatorList.get(9)); assertEquals("C", separatorList.get(10)); assertEquals("C", separatorList.get(11)); assertEquals(12, separatorList.size()); source.subList(5, 7).clear(); assertSeparatorEquals(separatorList.get(0), 6, "A"); assertEquals("A", separatorList.get(1)); assertEquals("A", separatorList.get(2)); assertEquals("A", separatorList.get(3)); assertSeparatorEquals(separatorList.get(4), 5, "B"); assertEquals("B", separatorList.get(5)); assertEquals("B", separatorList.get(6)); assertEquals("B", separatorList.get(7)); assertSeparatorEquals(separatorList.get(8), 5, "C"); assertEquals("C", separatorList.get(9)); assertEquals("C", separatorList.get(10)); assertEquals("C", separatorList.get(11)); assertEquals(12, separatorList.size()); source.subList(0, 5).clear(); assertSeparatorEquals(separatorList.get(0), 1, "A"); assertEquals("A", separatorList.get(1)); assertSeparatorEquals(separatorList.get(2), 5, "B"); assertEquals("B", separatorList.get(3)); assertEquals("B", separatorList.get(4)); assertEquals("B", separatorList.get(5)); assertSeparatorEquals(separatorList.get(6), 5, "C"); assertEquals("C", separatorList.get(7)); assertEquals("C", separatorList.get(8)); assertEquals("C", separatorList.get(9)); assertEquals(10, separatorList.size()); source.subList(0, 6).clear(); assertSeparatorEquals(separatorList.get(0), 5, "C"); assertEquals("C", separatorList.get(1)); assertEquals("C", separatorList.get(2)); assertEquals("C", separatorList.get(3)); assertEquals(4, separatorList.size()); }
@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();  }