private SequenceList(SortedList<E> source, Sequencer<E> sequencer, Comparator<? super E> comparator) { super(source); if (sequencer == null) throw new IllegalArgumentException("sequencer may not be null"); if (comparator == null) throw new IllegalArgumentException("comparator may not be null"); this.sequencer = sequencer; this.comparator = comparator; this.updateSequence(); source.addListEventListener(this); }
private SequenceList(SortedList<E> source, Sequencer<E> sequencer, Comparator<? super E> comparator) { super(source); if (sequencer == null) throw new IllegalArgumentException("sequencer may not be null"); if (comparator == null) throw new IllegalArgumentException("comparator may not be null"); this.sequencer = sequencer; this.comparator = comparator; this.updateSequence(); source.addListEventListener(this); }
private SequenceList(SortedList<E> source, Sequencer<E> sequencer, Comparator<? super E> comparator) { super(source); if (sequencer == null) throw new IllegalArgumentException("sequencer may not be null"); if (comparator == null) throw new IllegalArgumentException("comparator may not be null"); this.sequencer = sequencer; this.comparator = comparator; this.updateSequence(); source.addListEventListener(this); }
/** * A private constructor which allows us to use the {@link SortedList} as * the main decorated {@link EventList}. * * <p>The current implementation of {@link UniqueList} uses the {@link Grouper} * service to manage collapsing duplicates, which is more efficient than the * previous implementation that required a longer pipeline of {@link GroupingList}s. * * <p>UniqueList exposes a few extra querying methods like {@link #getCount(int)} * and {@link #getAll(int)} which require us to query the {@link Grouper}s * barcode, which retains state on groups. * * @param source a private {@link SortedList} whose {@link Comparator} never * changes, this is used to keep track of uniqueness. * @param dummyParameter dummy parameter to differentiate between the different * {@link GroupingList} constructors. */ private UniqueList(SortedList<E> source, Void dummyParameter) { super(source); // the grouper handles changes to the SortedList this.grouper = new Grouper<E>(source, new GrouperClient()); source.addListEventListener(this); }
/** * Create a new {@link SeparatorInjectorList} that groups together like * items using the Comparator from the <code>source</code>. Elements * that the {@link Comparator} determines are equal will share a common * separator. * * @param source the sorted list of items with a Comparator that defines * the group boundaries * @param defaultLimit the maximum number of items to include in a * group; all remaining items will be truncated */ public SeparatorInjectorList(SortedList<E> source, int defaultLimit) { super(source); this.defaultLimit = defaultLimit; // prepare the groups GrouperClient grouperClient = new GrouperClient(); this.grouper = new Grouper<E>(source, grouperClient); // initialize separators state rebuildSeparators(); // handle changes via the grouper source.addListEventListener(this); }
/** * Create a new {@link SeparatorInjectorList} that groups together like * items using the Comparator from the <code>source</code>. Elements * that the {@link Comparator} determines are equal will share a common * separator. * * @param source the sorted list of items with a Comparator that defines * the group boundaries * @param defaultLimit the maximum number of items to include in a * group; all remaining items will be truncated */ public SeparatorInjectorList(SortedList<E> source, int defaultLimit) { super(source); this.defaultLimit = defaultLimit; // prepare the groups GrouperClient grouperClient = new GrouperClient(); this.grouper = new Grouper<E>(source, grouperClient); // initialize separators state rebuildSeparators(); // handle changes via the grouper source.addListEventListener(this); }
/** * A private constructor which allows us to use the {@link SortedList} as * the main decorated {@link EventList}. * * <p>The current implementation of {@link UniqueList} uses the {@link Grouper} * service to manage collapsing duplicates, which is more efficient than the * previous implementation that required a longer pipeline of {@link GroupingList}s. * * <p>UniqueList exposes a few extra querying methods like {@link #getCount(int)} * and {@link #getAll(int)} which require us to query the {@link Grouper}s * barcode, which retains state on groups. * * @param source a private {@link SortedList} whose {@link Comparator} never * changes, this is used to keep track of uniqueness. * @param dummyParameter dummy parameter to differentiate between the different * {@link GroupingList} constructors. */ private UniqueList(SortedList<E> source, Void dummyParameter) { super(source); // the grouper handles changes to the SortedList this.grouper = new Grouper<E>(source, new GrouperClient()); source.addListEventListener(this); }
/** * A private constructor which allows us to use the {@link SortedList} as * the main decorated {@link EventList}. * * <p>The current implementation of {@link UniqueList} uses the {@link Grouper} * service to manage collapsing duplicates, which is more efficient than the * previous implementation that required a longer pipeline of {@link GroupingList}s. * * <p>UniqueList exposes a few extra querying methods like {@link #getCount(int)} * and {@link #getAll(int)} which require us to query the {@link Grouper}s * barcode, which retains state on groups. * * @param source a private {@link SortedList} whose {@link Comparator} never * changes, this is used to keep track of uniqueness. * @param dummyParameter dummy parameter to differentiate between the different * {@link GroupingList} constructors. */ private UniqueList(SortedList<E> source, Void dummyParameter) { super(source); // the grouper handles changes to the SortedList this.grouper = new Grouper<E>(source, new GrouperClient()); source.addListEventListener(this); }
/** * Create a new {@link SeparatorInjectorList} that groups together like * items using the Comparator from the <code>source</code>. Elements * that the {@link Comparator} determines are equal will share a common * separator. * * @param source the sorted list of items with a Comparator that defines * the group boundaries * @param defaultLimit the maximum number of items to include in a * group; all remaining items will be truncated */ public SeparatorInjectorList(SortedList<E> source, int defaultLimit) { super(source); this.defaultLimit = defaultLimit; // prepare the groups GrouperClient grouperClient = new GrouperClient(); this.grouper = new Grouper<E>(source, grouperClient); // initialize separators state rebuildSeparators(); // handle changes via the grouper source.addListEventListener(this); }
/** * Create a new {@link SeparatorInjectorList} that groups together like * items using the Comparator from the <code>source</code>. Elements * that the {@link Comparator} determines are equal will share a common * separator. * * @param source the sorted list of items with a Comparator that defines * the group boundaries * @param defaultLimit the maximum number of items to include in a * group; all remaining items will be truncated */ public SeparatorInjectorList(SortedList<E> source, int defaultLimit) { super(source); this.defaultLimit = defaultLimit; // prepare the groups GrouperClient grouperClient = new GrouperClient(); this.grouper = new Grouper<>(source, grouperClient); // initialize separators state rebuildSeparators(); // handle changes via the grouper source.addListEventListener(this); }
/** * A private constructor which provides a convenient handle to the * {@link SortedList} which will serve as the source of this list. * * @param source the elements to be grouped arranged in sorted order * @param comparator the {@link Comparator} used to determine groupings * @param dummyParameter dummy parameter to differentiate between the different * {@link GroupingList} constructors. */ private GroupingList(SortedList<E> source, Comparator<? super E> comparator, Void dummyParameter) { super(source); // the grouper handles changes to the SortedList this.grouper = new Grouper<E>(source, new GrouperClient()); // initialize the tree of GroupLists rebuildGroupListTreeFromBarcode(); source.addListEventListener(this); }
/** * A private constructor which provides a convenient handle to the * {@link SortedList} which will serve as the source of this list. * * @param source the elements to be grouped arranged in sorted order * @param comparator the {@link Comparator} used to determine groupings * @param dummyParameter dummy parameter to differentiate between the different * {@link GroupingList} constructors. */ private GroupingList(SortedList<E> source, Comparator<? super E> comparator, Void dummyParameter) { super(source); // the grouper handles changes to the SortedList this.grouper = new Grouper<E>(source, new GrouperClient()); // initialize the tree of GroupLists rebuildGroupListTreeFromBarcode(); source.addListEventListener(this); }
/** * A private constructor which provides a convenient handle to the * {@link SortedList} which will serve as the source of this list. * * @param source the elements to be grouped arranged in sorted order * @param comparator the {@link Comparator} used to determine groupings * @param dummyParameter dummy parameter to differentiate between the different * {@link GroupingList} constructors. */ private GroupingList(SortedList<E> source, Comparator<? super E> comparator, Void dummyParameter) { super(source); // the grouper handles changes to the SortedList this.grouper = new Grouper<E>(source, new GrouperClient()); // initialize the tree of GroupLists rebuildGroupListTreeFromBarcode(); source.addListEventListener(this); }