Mercurial > projects > dwt-addons
diff dwtx/core/commands/common/HandleObjectManager.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 | 6518c18a01f7 |
children |
line wrap: on
line diff
--- a/dwtx/core/commands/common/HandleObjectManager.d Sun Aug 03 17:01:51 2008 +0200 +++ b/dwtx/core/commands/common/HandleObjectManager.d Thu Aug 07 15:01:33 2008 +0200 @@ -16,11 +16,8 @@ import dwtx.core.commands.common.HandleObject; import dwtx.core.commands.common.EventManager; import dwt.dwthelper.utils; +import dwtx.dwtxhelper.Collection; -import tango.util.collection.HashSet; -import tango.util.collection.HashMap; -import tango.util.collection.model.Set; -import tango.util.collection.model.Map; // import java.util.HashMap; // import java.util.HashSet; @@ -45,18 +42,18 @@ * The set of handle objects that are defined. This value may be empty, but * it is never <code>null</code>. */ - protected const Set!(Object) definedHandleObjects; + protected const Set definedHandleObjects; /** * The map of identifiers (<code>String</code>) to handle objects ( * <code>HandleObject</code>). This collection may be empty, but it is * never <code>null</code>. */ - protected const Map!( String, Object ) handleObjectsById; + protected const Map handleObjectsById; public this(){ - definedHandleObjects = new HashSet!(Object)(); - handleObjectsById = new HashMap!( String, Object )(); + definedHandleObjects = new HashSet(); + handleObjectsById = new HashMap(); } /** @@ -84,11 +81,13 @@ * @return The set of defined handle object identifiers; this value may be * empty, but it is never <code>null</code>. */ - protected final HashSet!(String) getDefinedHandleObjectIds() { - HashSet!(String) definedHandleObjectIds = new HashSet!(String)(/+definedHandleObjects - .size()+/); - foreach ( v; definedHandleObjects.elements() ) { - auto handleObject = cast(HandleObject)v; + protected final HashSet getDefinedHandleObjectIds() { + HashSet definedHandleObjectIds = new HashSet(definedHandleObjects + .size()); + Iterator handleObjectItr = definedHandleObjects.iterator(); + while (handleObjectItr.hasNext()) { + HandleObject handleObject = cast(HandleObject) handleObjectItr + .next(); String id = handleObject.getId(); definedHandleObjectIds.add(id); }