/** * Creates a new {@link EventList} which contains the given elements. * * @param contents the list elements, if <code>null</code> the result will be an empty list * @return the new {@link EventList} */ public static <E> EventList<E> eventListOf(E... contents) { return eventList(contents == null ? Collections.<E>emptyList() : Arrays.asList(contents)); }
/** * Creates a new {@link EventList} which contains the given elements. * * @param contents the list elements, if <code>null</code> the result will be an empty list * @return the new {@link EventList} */ public static <E> EventList<E> eventListOf(E... contents) { return eventList(contents == null ? Collections.<E>emptyList() : Arrays.asList(contents)); }
/** * Creates a new {@link EventList} which contains the given elements. * * @param contents the list elements, if <code>null</code> the result will be an empty list * @return the new {@link EventList} */ public static <E> EventList<E> eventListOf(E... contents) { return eventList(contents == null ? Collections.<E>emptyList() : Arrays.asList(contents)); }
/** * Creates a new {@link EventList} with the given {@link ListEventPublisher} and * {@link ReadWriteLock} which contains the given elements. * * @param publisher the {@link ListEventPublisher} for the new list, may be <code>null</code> * @param lock the {@link ReadWriteLock} for the new list, may be <code>null</code> * @param contents the list elements, if <code>null</code> the result will be an empty list * @return the new {@link EventList} */ public static <E> EventList<E> eventListOf(ListEventPublisher publisher, ReadWriteLock lock, E... contents) { return eventList(publisher, lock, contents == null ? Collections.<E>emptyList() : Arrays .asList(contents)); }
/** * Creates a new {@link EventList} with the given {@link ListEventPublisher} and * {@link ReadWriteLock} which contains the given elements. * * @param publisher the {@link ListEventPublisher} for the new list, may be <code>null</code> * @param lock the {@link ReadWriteLock} for the new list, may be <code>null</code> * @param contents the list elements, if <code>null</code> the result will be an empty list * @return the new {@link EventList} */ public static <E> EventList<E> eventListOf(ListEventPublisher publisher, ReadWriteLock lock, E... contents) { return eventList(publisher, lock, contents == null ? Collections.<E>emptyList() : Arrays .asList(contents)); }
/** * Creates a new {@link EventList} with the given {@link ListEventPublisher} and * {@link ReadWriteLock} which contains the given elements. * * @param publisher the {@link ListEventPublisher} for the new list, may be <code>null</code> * @param lock the {@link ReadWriteLock} for the new list, may be <code>null</code> * @param contents the list elements, if <code>null</code> the result will be an empty list * @return the new {@link EventList} */ public static <E> EventList<E> eventListOf(ListEventPublisher publisher, ReadWriteLock lock, E... contents) { return eventList(publisher, lock, contents == null ? Collections.<E>emptyList() : Arrays .asList(contents)); }
@Override public EventList<E> create(Object context) { if (this.eventList != null) { return this.eventList; } try { Method valuesMethod = this.enumClass.getMethod("values"); @SuppressWarnings("unchecked") E[] values = (E[]) valuesMethod.invoke(null); this.eventList = GlazedLists.eventList(Arrays.asList(values)); return this.eventList; } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new LocalizableException("EnumModelFactory.CannotGetEnumValues", this.enumClass.getName(), ex); } } }
@Benchmark @Warmup(iterations = 5) @Measurement(iterations = 10) @Fork(1) public EventList<Integer> testIndexedTree() { EventList<Integer> baseCopy = GlazedLists.eventList(base); EventList<Integer> sortedBase = new SortedListWithIndexedTree<>(baseCopy); doTest(baseCopy, sortedBase); return sortedBase; }
@Benchmark @Warmup(iterations = 5) @Measurement(iterations = 10) @Fork(1) public EventList<Integer> testBarcode() { EventList<Integer> baseCopy = GlazedLists.eventList(base); EventList<Integer> sortedBase = new SortedList<>(baseCopy); doTest(baseCopy, sortedBase); return sortedBase; }
oldMediaFileEventList = GlazedLists.eventList(new ArrayList<MediaFileContainer>()); oldMediaFileTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(oldMediaFileEventList), new MediaFileTableFormat()); newMediaFileEventList = GlazedLists.eventList(new ArrayList<MediaFileContainer>()); newMediaFileTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(newMediaFileEventList), new MediaFileTableFormat());
@Benchmark @Warmup(iterations = 5) @Measurement(iterations = 10) @Fork(1) public EventList<Element> testSeparatorListCrudNew() { EventList<Element> baseCopy = GlazedLists.eventList(base); EventList<Element> sepBase = new SeparatorList<>(baseCopy, elementComparator(), 0, Integer.MAX_VALUE); doTest(baseCopy, sepBase); return sepBase; }
@Benchmark @Warmup(iterations = 5) @Measurement(iterations = 10) @Fork(1) public EventList<Element> testSeparatorListCrudOld() { EventList<Element> baseCopy = GlazedLists.eventList(base); EventList<Element> sepBase = new SeparatorListOld<>(baseCopy, elementComparator(), 0, Integer.MAX_VALUE); doTest(baseCopy, sepBase); return sepBase; }
@Benchmark @Warmup(iterations = 5) @Measurement(iterations = 10) @Fork(1) public EventList<Element> testSeparatorListCrudTransactionNew() { EventList<Element> baseCopy = GlazedLists.eventList(base); TransactionList<Element> transactionList = new TransactionList<>(baseCopy); EventList<Element> sepBase = new SeparatorList<>(transactionList, elementComparator(), 0, Integer.MAX_VALUE); doTestTransaction(transactionList, sepBase); return sepBase; }
@Benchmark @Warmup(iterations = 5) @Measurement(iterations = 10) @Fork(1) public EventList<Element> testSeparatorListCrudTransactionOld() { EventList<Element> baseCopy = GlazedLists.eventList(base); TransactionList<Element> transactionList = new TransactionList<>(baseCopy); EventList<Element> sepBase = new SeparatorListOld<>(transactionList, elementComparator(), 0, Integer.MAX_VALUE); doTestTransaction(transactionList, sepBase); return sepBase; }
@Benchmark @Warmup(iterations = 5) @Measurement(iterations = 10) @Fork(1) public EventList<Element> testSeparatorListFilterOld() { EventList<Element> baseCopy = GlazedLists.eventList(base); FilterList<Element> filterList = new FilterList<>(baseCopy); EventList<Element> sepBase = new SeparatorListOld<>(filterList, elementComparator(), 0, Integer.MAX_VALUE); for (int i = 0; i < 10; i++) { filterList.setMatcher(Matchers.falseMatcher()); filterList.setMatcher(Matchers.trueMatcher()); } return sepBase; }
@Benchmark @Warmup(iterations = 5) @Measurement(iterations = 10) @Fork(1) public EventList<Element> testSeparatorListFilterNew() { EventList<Element> baseCopy = GlazedLists.eventList(base); FilterList<Element> filterList = new FilterList<>(baseCopy); EventList<Element> sepBase = new SeparatorList<>(filterList, elementComparator(), 0, Integer.MAX_VALUE); for (int i = 0; i < 10; i++) { filterList.setMatcher(Matchers.falseMatcher()); filterList.setMatcher(Matchers.trueMatcher()); } return sepBase; }