@Test public void testSetComparator() { final BasicEventList<String> source = new BasicEventList<>(); final UniqueList<String> uniqueList = new UniqueList<>(source, GlazedListsTests.getFirstLetterComparator()); ListConsistencyListener.install(uniqueList); source.add("Black"); source.add("Blind"); source.add("Bling"); assertEquals(1, uniqueList.size()); assertEquals("Black", uniqueList.get(0)); uniqueList.setComparator(GlazedListsTests.getLastLetterComparator()); assertEquals(3, uniqueList.size()); assertEquals("Blind", uniqueList.get(0)); assertEquals("Bling", uniqueList.get(1)); assertEquals("Black", uniqueList.get(2)); uniqueList.setComparator(GlazedListsTests.getFirstLetterComparator()); assertEquals(1, uniqueList.size()); assertEquals("Black", uniqueList.get(0)); uniqueList.setComparator(null); assertEquals(3, uniqueList.size()); assertEquals("Black", uniqueList.get(0)); assertEquals("Blind", uniqueList.get(1)); assertEquals("Bling", uniqueList.get(2)); }
public void setComparator(Comparator<? super E> comparator) { if (comparator == null) comparator = (Comparator) GlazedLists.comparableComparator(); ((SortedList<E>) this.source).setComparator(comparator); }
UniqueList extends TransformedList<E, E> { public void setComparator(Comparator<? super E> comparator) { if (comparator == null) comparator = (Comparator) GlazedLists.comparableComparator(); ((SortedList<E>) this.source).setComparator(comparator); } }
UniqueList extends TransformedList<E, E> { public void setComparator(Comparator<? super E> comparator) { if (comparator == null) comparator = (Comparator) GlazedLists.comparableComparator(); ((SortedList<E>) this.source).setComparator(comparator); } UniqueList(EventList<E> source);  UniqueList(EventList<E> source, Comparator<? super E> comparator); private  UniqueList(SortedList<E> source, Void dummyParameter); }
UniqueList extends TransformedList<E, E> { public void setComparator(Comparator<? super E> comparator) { if (comparator == null) comparator = (Comparator) GlazedLists.comparableComparator(); ((SortedList<E>) this.source).setComparator(comparator); } UniqueList(EventList<E> source);  UniqueList(EventList<E> source, Comparator<? super E> comparator); private  UniqueList(SortedList<E> source, Void dummyParameter); static UniqueList<E> create(EventList<E> source); void setComparator(Comparator<? super E> comparator); @Override int size(); @Override E remove(int index); @Override E set(int index, E value); @Override int indexOf(Object element); @Override void listChanged(ListEvent<E> listChanges); int getCount(int index); int getCount(E value); List<E> getAll(int index); List<E> getAll(E value); @Override void dispose(); }
UniqueList extends TransformedList<E, E> { public void setComparator(Comparator<? super E> comparator) { if (comparator == null) comparator = (Comparator) GlazedLists.comparableComparator(); ((SortedList<E>) this.source).setComparator(comparator); } UniqueList(EventList<E> source);  UniqueList(EventList<E> source, Comparator<? super E> comparator); private  UniqueList(SortedList<E> source, Void dummyParameter); static UniqueList<E> create(EventList<E> source); void setComparator(Comparator<? super E> comparator); @Override int size(); @Override E remove(int index); @Override E set(int index, E value); @Override int indexOf(Object element); @Override void listChanged(ListEvent<E> listChanges); int getCount(int index); int getCount(E value); List<E> getAll(int index); List<E> getAll(E value); @Override void dispose();  }