/** * Clears the data from the trees efficiently. */ public void clear() { start = new SimpleTree<V>(GlazedLists.comparableComparator()); end = new SimpleTree<V>(GlazedLists.comparableComparator()); }
/** * Clears the data from the trees efficiently. */ public void clear() { start = new SimpleTree<V>(GlazedLists.comparableComparator()); end = new SimpleTree<V>(GlazedLists.comparableComparator()); }
/** * Clears the data from the trees efficiently. */ public void clear() { start = new SimpleTree<V>(GlazedLists.comparableComparator()); end = new SimpleTree<V>(GlazedLists.comparableComparator()); }
/** * Creates a {@link CachingList} that caches elements from the specified source * {@link ca.odell.glazedlists.EventList}. * * @param source The source list to use to get values from * @param maxSize The maximum size of the cache */ public CachingList(EventList source, int maxSize) { super(source); readWriteLock = new CacheLock(readWriteLock); this.maxSize = maxSize; cache = new SimpleTree<AgedNode>(new AgedNodeComparator()); indexTree = new SparseList(); indexTree.addNulls(0, source.size()); source.addListEventListener(this); lastKnownSize = source.size(); }
/** * Creates a {@link CachingList} that caches elements from the specified source * {@link ca.odell.glazedlists.EventList}. * * @param source The source list to use to get values from * @param maxSize The maximum size of the cache */ public CachingList(EventList source, int maxSize) { super(source); readWriteLock = new CacheLock(readWriteLock); this.maxSize = maxSize; cache = new SimpleTree<AgedNode>(new AgedNodeComparator()); indexTree = new SparseList(); indexTree.addNulls(0, source.size()); source.addListEventListener(this); lastKnownSize = source.size(); }
/** * Creates a {@link CachingList} that caches elements from the specified source * {@link ca.odell.glazedlists.EventList}. * * @param source The source list to use to get values from * @param maxSize The maximum size of the cache */ public CachingList(EventList source, int maxSize) { super(source); readWriteLock = new CacheLock(readWriteLock); this.maxSize = maxSize; cache = new SimpleTree<AgedNode>(new AgedNodeComparator()); indexTree = new SparseList(); indexTree.addNulls(0, source.size()); source.addListEventListener(this); lastKnownSize = source.size(); }
if(comparator != null) treeComparator = new ElementComparator(comparator); else treeComparator = new ElementRawOrderComparator(); sorted = new SimpleTree<Element>(treeComparator); unsorted = new SimpleTree<Element>();
if(comparator != null) treeComparator = new ElementComparator(comparator); else treeComparator = new ElementRawOrderComparator(); sorted = new SimpleTree<Element>(treeComparator); unsorted = new SimpleTree<Element>();
if(comparator != null) treeComparator = new ElementComparator(comparator); else treeComparator = new ElementRawOrderComparator(); sorted = new SimpleTree<Element>(treeComparator); unsorted = new SimpleTree<Element>();
/** * Statically build the separators data structures. */ private void rebuildSeparators() { // clear the initial state of these separators insertedSeparators = new Barcode(); separators = new SimpleTree<GroupSeparator>(); // prepare the separator list insertedSeparators.add(0, SOURCE_ELEMENT, source.size()); for(BarcodeIterator i = grouper.getBarcode().iterator(); i.hasNextColour(Grouper.UNIQUE); ) { i.nextColour(Grouper.UNIQUE); int groupIndex = i.getColourIndex(Grouper.UNIQUE); int sourceIndex = i.getIndex(); insertedSeparators.add(groupIndex + sourceIndex, SEPARATOR, 1); Element<GroupSeparator> node = separators.add(groupIndex, new GroupSeparator(), 1); node.get().setNode(node); node.get().applyLimit(defaultLimit, false); } // update the cached values in all separators for(int i = 0; i < separators.size(); i++) { separators.get(i).get().updateCachedValues(); } }
/** * Statically build the separators data structures. */ private void rebuildSeparators() { // clear the initial state of these separators insertedSeparators = new Barcode(); separators = new SimpleTree<GroupSeparator>(); // prepare the separator list insertedSeparators.add(0, SOURCE_ELEMENT, source.size()); for(BarcodeIterator i = grouper.getBarcode().iterator(); i.hasNextColour(Grouper.UNIQUE); ) { i.nextColour(Grouper.UNIQUE); int groupIndex = i.getColourIndex(Grouper.UNIQUE); int sourceIndex = i.getIndex(); insertedSeparators.add(groupIndex + sourceIndex, SEPARATOR, 1); Element<GroupSeparator> node = separators.add(groupIndex, new GroupSeparator(), 1); node.get().setNode(node); node.get().applyLimit(defaultLimit, false); } // update the cached values in all separators for(int i = 0; i < separators.size(); i++) { separators.get(i).get().updateCachedValues(); } }
/** * Statically build the separators data structures. */ private void rebuildSeparators() { // clear the initial state of these separators insertedSeparators = new Barcode(); separators = new SimpleTree<>(); // prepare the separator list insertedSeparators.add(0, SOURCE_ELEMENT, source.size()); for(BarcodeIterator i = grouper.getBarcode().iterator(); i.hasNextColour(Grouper.UNIQUE); ) { i.nextColour(Grouper.UNIQUE); int groupIndex = i.getColourIndex(Grouper.UNIQUE); int sourceIndex = i.getIndex(); insertedSeparators.add(groupIndex + sourceIndex, SEPARATOR, 1); Element<GroupSeparator> node = separators.add(groupIndex, new GroupSeparator(), 1); node.get().setNode(node); node.get().applyLimit(defaultLimit, false); } // update the cached values in all separators for(int i = 0; i < separators.size(); i++) { separators.get(i).get().updateCachedValues(); } }
/** * Statically build the separators data structures. */ private void rebuildSeparators() { // clear the initial state of these separators insertedSeparators = new Barcode(); separators = new SimpleTree<GroupSeparator>(); // prepare the separator list insertedSeparators.add(0, SOURCE_ELEMENT, source.size()); for(BarcodeIterator i = grouper.getBarcode().iterator(); i.hasNextColour(Grouper.UNIQUE); ) { i.nextColour(Grouper.UNIQUE); int groupIndex = i.getColourIndex(Grouper.UNIQUE); int sourceIndex = i.getIndex(); insertedSeparators.add(groupIndex + sourceIndex, SEPARATOR, 1); Element<GroupSeparator> node = separators.add(groupIndex, new GroupSeparator(), 1); node.get().setNode(node); node.get().applyLimit(defaultLimit, false); } // update the cached values in all separators for(int i = 0; i < separators.size(); i++) { separators.get(i).get().updateCachedValues(); } }