Author: kono
Date: 2011-01-24 16:45:05 -0800 (Mon, 24 Jan 2011)
New Revision: 23590

Modified:
   
core3/io-impl/trunk/src/main/java/org/cytoscape/io/internal/read/attrs/MapNetworkAttrTask.java
Log:
type field is changed to Class.

Modified: 
core3/io-impl/trunk/src/main/java/org/cytoscape/io/internal/read/attrs/MapNetworkAttrTask.java
===================================================================
--- 
core3/io-impl/trunk/src/main/java/org/cytoscape/io/internal/read/attrs/MapNetworkAttrTask.java
      2011-01-25 00:31:37 UTC (rev 23589)
+++ 
core3/io-impl/trunk/src/main/java/org/cytoscape/io/internal/read/attrs/MapNetworkAttrTask.java
      2011-01-25 00:45:05 UTC (rev 23590)
@@ -21,12 +21,12 @@
        @Tunable(description="Map to current network only")
        public boolean currentNetworkOnly = true;
 
-       private final CyTableEntry type; // Must be node or edge!
+       private final Class<? extends CyTableEntry> type; // Must be node or 
edge!
        private final CyTable newGlobalTable;
        private final CyNetworkManager networkManager;
        final private CyApplicationManager applicationManager;
 
-       public MapNetworkAttrTask(final CyTableEntry type, final CyTable 
newGlobalTable,
+       public MapNetworkAttrTask(final Class<? extends CyTableEntry> type, 
final CyTable newGlobalTable,
                                  final CyNetworkManager networkManager,
                                  final CyApplicationManager applicationManager)
        {
@@ -35,7 +35,7 @@
                this.networkManager     = networkManager;
                this.applicationManager = applicationManager;
 
-               if (!(type instanceof CyNode) && !(type instanceof CyEdge))
+               if ( type != CyNode.class && type != CyEdge.class)
                        throw new IllegalArgumentException("\"type\" must be 
CyNode.class or CyEdge.class!");
        }
 
@@ -45,12 +45,12 @@
                final List<CyTable> targetTables = new ArrayList<CyTable>();
                if (currentNetworkOnly) {
                        final CyNetwork currentNetwork = 
applicationManager.getCurrentNetwork();
-                       targetTables.add(type instanceof CyNode ? 
currentNetwork.getDefaultNodeTable()
+                       targetTables.add(type == CyNode.class ? 
currentNetwork.getDefaultNodeTable()
                                                                : 
currentNetwork.getDefaultEdgeTable());
                } else {
                        final Set<CyNetwork> networks = 
networkManager.getNetworkSet();
                        for (final CyNetwork network : networks)
-                               targetTables.add(type instanceof CyNode ? 
network.getDefaultNodeTable()
+                               targetTables.add(type == CyNode.class ? 
network.getDefaultNodeTable()
                                                                        : 
network.getDefaultEdgeTable());
                }
 

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to