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