comparison dwtx/jface/viewers/deferred/LazySortedCollection.d @ 104:04b47443bb01

Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections. These new wrappers now use the tango.util.containers instead of the tango.util.collections.
author Frank Benoit <benoit@tionex.de>
date Thu, 07 Aug 2008 15:01:33 +0200
parents b6c35faf97c8
children
comparison
equal deleted inserted replaced
103:2d6540440fe6 104:04b47443bb01
15 import dwtx.jface.viewers.deferred.IntHashMap; 15 import dwtx.jface.viewers.deferred.IntHashMap;
16 import dwtx.jface.viewers.deferred.FastProgressReporter; 16 import dwtx.jface.viewers.deferred.FastProgressReporter;
17 // import java.util.Collection; 17 // import java.util.Collection;
18 // import java.util.Comparator; 18 // import java.util.Comparator;
19 // import java.util.Iterator; 19 // import java.util.Iterator;
20 import tango.util.collection.model.View;
21 20
22 import dwtx.core.runtime.Assert; 21 import dwtx.core.runtime.Assert;
23 22
24 import dwt.dwthelper.utils; 23 import dwt.dwthelper.utils;
24 import dwtx.dwtxhelper.Collection;
25 25
26 /** 26 /**
27 * This object maintains a collection of elements, sorted by a comparator 27 * This object maintains a collection of elements, sorted by a comparator
28 * given in the constructor. The collection is lazily sorted, allowing 28 * given in the constructor. The collection is lazily sorted, allowing
29 * more efficient runtimes for most methods. There are several methods on this 29 * more efficient runtimes for most methods. There are several methods on this
765 /** 765 /**
766 * Adds all items from the given collection to this collection 766 * Adds all items from the given collection to this collection
767 * 767 *
768 * @param toAdd objects to add 768 * @param toAdd objects to add
769 */ 769 */
770 public final void addAll( View!(Object) toAdd) { 770 public final void addAll( Collection toAdd) {
771 Assert.isNotNull(cast(Object)toAdd); 771 Assert.isNotNull(cast(Object)toAdd);
772 foreach( o; toAdd ){ 772 Iterator iter = toAdd.iterator();
773 add( o ); 773 while (iter.hasNext()) {
774 add(iter.next());
774 } 775 }
775 776
776 testInvariants(); 777 testInvariants();
777 } 778 }
778 779