Author: mes
Date: 2010-12-09 11:29:40 -0800 (Thu, 09 Dec 2010)
New Revision: 23148

Modified:
   core3/model-api/trunk/src/main/java/org/cytoscape/model/CyNetwork.java
   
core3/model-api/trunk/src/test/java/org/cytoscape/model/AbstractCyNetworkTest.java
Log:
added convenience methods for accessing the attribute tables for nodes, edges, 
and networks

Modified: core3/model-api/trunk/src/main/java/org/cytoscape/model/CyNetwork.java
===================================================================
--- core3/model-api/trunk/src/main/java/org/cytoscape/model/CyNetwork.java      
2010-12-09 18:39:11 UTC (rev 23147)
+++ core3/model-api/trunk/src/main/java/org/cytoscape/model/CyNetwork.java      
2010-12-09 19:29:40 UTC (rev 23148)
@@ -210,4 +210,27 @@
         */
        List<CyEdge> getConnectingEdgeList(CyNode source, CyNode target, 
CyEdge.Type edgeType);
 
+       /**
+        * A convenience method returns the default attribute table for this 
network.
+        * This is equivalent to 
+        * 
<code>cyTableManager.getTableMap(CyNetwork.class,this).get(CyNetwork.DEFAULT_ATTRS);</code>
+        * @return The default attribute table for this network.
+        */
+       CyTable getDefaultNetworkTable();
+
+       /**
+        * A convenience method returns the default attribute table for the 
nodes of this network.
+        * This is equivalent to 
+        * 
<code>cyTableManager.getTableMap(CyNode.class,this).get(CyNetwork.DEFAULT_ATTRS);</code>
+        * @return The default attribute table for the nodes of this network.
+        */
+       CyTable getDefaultNodeTable();
+
+       /**
+        * A convenience method returns the default attribute table for the 
edges of this network.
+        * This is equivalent to 
+        * 
<code>cyTableManager.getTableMap(CyEdge.class,this).get(CyNetwork.DEFAULT_ATTRS);</code>
+        * @return The default attribute table for the edges of this network.
+        */
+       CyTable getDefaultEdgeTable();
 }

Modified: 
core3/model-api/trunk/src/test/java/org/cytoscape/model/AbstractCyNetworkTest.java
===================================================================
--- 
core3/model-api/trunk/src/test/java/org/cytoscape/model/AbstractCyNetworkTest.java
  2010-12-09 18:39:11 UTC (rev 23147)
+++ 
core3/model-api/trunk/src/test/java/org/cytoscape/model/AbstractCyNetworkTest.java
  2010-12-09 19:29:40 UTC (rev 23148)
@@ -936,4 +936,19 @@
        public void testDefaultAttributes() {
                assertEquals(String.class, 
net.getCyRow().getDataTable().getColumnTypeMap().get("name"));
        }
+
+       public void testGetDefaultNetworkTable() {
+               assertNotNull(net.getDefaultNetworkTable());
+               assertEquals(String.class, 
net.getDefaultNetworkTable().getColumnTypeMap().get("name"));
+       }
+
+       public void testGetDefaultNodeTable() {
+               assertNotNull(net.getDefaultNodeTable());
+               assertEquals(String.class, 
net.getDefaultNodeTable().getColumnTypeMap().get("name"));
+       }
+
+       public void testGetDefaultEdgeTable() {
+               assertNotNull(net.getDefaultEdgeTable());
+               assertEquals(String.class, 
net.getDefaultEdgeTable().getColumnTypeMap().get("name"));
+       }
 }

-- 
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