@Test public void testAdd() { EventList<String> source = new BasicEventList<>(); SeparatorList<String> separated = new SeparatorList<>(source, String.CASE_INSENSITIVE_ORDER, 1, Integer.MAX_VALUE); source.addAll(GlazedListsTests.stringToList("ABCABCABC")); assertEquals(9, source.size()); assertEquals(12, separated.size()); assertEquals("A", source.get(0)); assertEquals("A", separated.get(1)); separated.add(1, "A"); assertEqualsIgnoreSeparators(source, separated, String.CASE_INSENSITIVE_ORDER); assertEquals("B", source.get(5)); assertEquals("B", separated.get(7)); separated.add(7, "B"); assertEqualsIgnoreSeparators(source, separated, String.CASE_INSENSITIVE_ORDER); assertEquals("C", source.get(10)); assertEquals("C", separated.get(13)); separated.add(13, "C"); assertEqualsIgnoreSeparators(source, separated, String.CASE_INSENSITIVE_ORDER); assertEquals("C", source.get(11)); assertEquals("C", separated.get(14)); separated.add("C"); assertEqualsIgnoreSeparators(source, separated, String.CASE_INSENSITIVE_ORDER); try { separated.add(0, "This should fail"); fail("failed to receive an IllegalArgumentException when accessing an index that stores a separator"); } catch (IllegalArgumentException 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 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();  }