Author: mes
Date: 2011-09-01 16:38:39 -0700 (Thu, 01 Sep 2011)
New Revision: 26698
Modified:
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableEntryImpl.java
Log:
now caching CyRow
Modified:
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableEntryImpl.java
===================================================================
---
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableEntryImpl.java
2011-09-01 22:51:05 UTC (rev 26697)
+++
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyTableEntryImpl.java
2011-09-01 23:38:39 UTC (rev 26698)
@@ -41,12 +41,14 @@
class CyTableEntryImpl implements CyTableEntry, Identifiable {
private final long suid;
private final Map<String, CyTable> attrMgr;
+ private final CyRow defaultRow;
CyTableEntryImpl(final Map<String, CyTable> attrMgr, long suid) {
this.suid = suid;
this.attrMgr = attrMgr;
- getCyRow().set(CyTableEntry.NAME, "");
- getCyRow().set(CyNetwork.SELECTED, Boolean.FALSE);
+ this.defaultRow =
attrMgr.get(CyNetwork.DEFAULT_ATTRS).getRow(suid);
+ defaultRow.set(CyTableEntry.NAME, "");
+ defaultRow.set(CyNetwork.SELECTED, Boolean.FALSE);
}
CyTableEntryImpl(final Map<String, CyTable> attrMgr) {
@@ -81,11 +83,6 @@
* @return DOCUMENT ME!
*/
final public CyRow getCyRow() {
- final CyTable mgr = attrMgr.get(CyNetwork.DEFAULT_ATTRS);
- if (mgr == null)
- throw new NullPointerException("attribute manager is
null for namespace: "
- +
CyNetwork.DEFAULT_ATTRS);
-
- return mgr.getRow(suid);
+ return defaultRow;
}
}
--
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.