Author: jm
Date: 2012-09-06 13:54:52 -0700 (Thu, 06 Sep 2012)
New Revision: 30328
Modified:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetwork.java
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetworkTableManager.java
Log:
Fixes #1438: Improved documentation about network-table namespaces.
Modified:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetwork.java
===================================================================
--- core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetwork.java
2012-09-06 20:06:13 UTC (rev 30327)
+++ core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetwork.java
2012-09-06 20:54:52 UTC (rev 30328)
@@ -314,7 +314,7 @@
* Returns the table with the specified namespace and type from this
* network.
* @param type Type of {@link CyIdentifiable} associated with the table.
- * @param namespace The name of the table relative to the network.
+ * @param namespace the {@link CyNetworkTableManager namespace} the
table should belong to.
* @return the table with the specified namespace and type from the
* network.
*/
@@ -325,10 +325,10 @@
* A null entry or a an entry not found in this network will return
null,
* but otherwise every node or edge in the network is guaranteed to
have a row.
* @param entry The entry (node, edge, network) whose row we're looking
for.
- * @param tableName the name of the table from which to extract the
row..
+ * @param namespace the {@link CyNetworkTableManager namespace} of the
table from which to extract the row.
* @return the row in the table of the specified name for this object.
*/
- CyRow getRow(CyIdentifiable entry, String tableName);
+ CyRow getRow(CyIdentifiable entry, String namespace);
/**
* A convenience method that returns the row in the default table
Modified:
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetworkTableManager.java
===================================================================
---
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetworkTableManager.java
2012-09-06 20:06:13 UTC (rev 30327)
+++
core3/api/trunk/model-api/src/main/java/org/cytoscape/model/CyNetworkTableManager.java
2012-09-06 20:54:52 UTC (rev 30328)
@@ -4,7 +4,35 @@
import java.util.Set;
/**
- * Provides access to all network-table relationships.
+ * <p>Provides access to all network-table relationships.
<code>CyTable</code>s
+ * can be associated with a <code>CyNetwork</code> by being assigned a
+ * <em>type</em> and <em>namespace</em> within that
+ * <code>CyNetwork</code>. For example, a <code>CyTable</code> that stores
+ * <code>CyNode</code> attributes would be of type <code>CyNode.class</code>.
+ * You can associate multiple <code>CyTables</code> of a particular type
+ * to a <code>CyNetwork</code> as long as each of those <code>CyTable</code>s
+ * has a different namespace. For instance, to add multiple node tables to a
+ * <code>CyNetwork</code>, you would call:</p>
+ *
+ * <pre>
+ * setTable(network, CyNode.class, "my namespace", nodeTable1);
+ * setTable(network, CyNode.class, "my other namespace", nodeTable2);
+ * </pre>
+ *
+ * <p>So the triple (<code>CyNetwork</code>, type, namespace) refers to exactly
+ * one table at any given time. It's also possible to associate the same
+ * <code>CyTable</code> with multiple (<code>CyNetwork</code>, type, namespace)
+ * combinations.</p>
+ *
+ * <p>By default, <code>CyNetwork</code>s are associated with network, node,
and edge tables
+ * for each of the following namespaces:</p>
+ *
+ * <ul>
+ * <li>CyNetwork.DEFAULT_ATTRS</li>
+ * <li>CyNetwork.LOCAL_ATTRS</li>
+ * <li>CyNetwork.HIDDEN_ATTRS</li>
+ * </ul>
+ *
* @CyAPI.Api.Interface
*/
public interface CyNetworkTableManager {
@@ -12,7 +40,7 @@
* Associates the given table to the network using the specified
namespace and type.
* @param network the {@link CyNetwork} to associate the given table to.
* @param type Type of {@link CyIdentifiable} associated with the table.
- * @param namespace The name of the table relative to the network.
+ * @param namespace the {@link CyNetworkTableManager namespace} the
table should belong to.
* @param table the table to associate to the network with the
specified namespace and type.
*/
void setTable(CyNetwork network, Class<? extends CyIdentifiable> type,
String namespace, CyTable table);
@@ -22,7 +50,7 @@
* network.
* @param network the network to check for the table.
* @param type Type of {@link CyIdentifiable} associated with the table.
- * @param namespace The name of the table relative to the network.
+ * @param namespace the {@link CyNetworkTableManager namespace} the
table should belong to.
* @return the table with the specified namespace and type from the
* network.
*/
@@ -33,7 +61,7 @@
* the network.
* @param network the network to remove the table from.
* @param type Type of {@link CyIdentifiable} associated with the table.
- * @param namespace The name of the table relative to the network.
+ * @param namespace the {@link CyNetworkTableManager namespace} the
table should belong to.
*/
void removeTable(CyNetwork network, Class<? extends CyIdentifiable>
type, String namespace);
--
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.