Author: ruschein
Date: 2010-11-10 14:08:56 -0800 (Wed, 10 Nov 2010)
New Revision: 22804
Modified:
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/InDegree.java
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/OutDegree.java
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/SourceID.java
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/TargetID.java
Log:
Fixed various function argument types.
Modified:
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/InDegree.java
===================================================================
---
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/InDegree.java
2010-11-10 22:05:26 UTC (rev 22803)
+++
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/InDegree.java
2010-11-10 22:08:56 UTC (rev 22804)
@@ -37,6 +37,7 @@
import org.cytoscape.equations.AbstractFunction;
import org.cytoscape.equations.ArgDescriptor;
import org.cytoscape.equations.ArgType;
+import org.cytoscape.equations.FunctionUtil;
import org.cytoscape.equations.internal.SUIDToNodeMapper;
import org.cytoscape.session.CyApplicationManager;
@@ -49,7 +50,7 @@
public InDegree(final SUIDToNodeMapper suidToNodeMapper,
final CyApplicationManager applicationManager)
{
- super(new ArgDescriptor[] { new
ArgDescriptor(ArgType.STRICT_INT, "node_ID", "An ID identifying a node.") });
+ super(new ArgDescriptor[] { new ArgDescriptor(ArgType.INT,
"node_ID", "An ID identifying a node.") });
this.suidToNodeMapper = suidToNodeMapper;
this.applicationManager = applicationManager;
}
@@ -73,7 +74,7 @@
* @return the result of the function evaluation which is the natural
logarithm of the first argument
*/
public Object evaluateFunction(final Object[] args) {
- final Long nodeID = (Long)args[0];
+ final Long nodeID = FunctionUtil.getArgAsLong(args[0]);
final CyNetwork currentNetwork =
applicationManager.getCurrentNetwork();
if (currentNetwork == null)
Modified:
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/OutDegree.java
===================================================================
---
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/OutDegree.java
2010-11-10 22:05:26 UTC (rev 22803)
+++
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/OutDegree.java
2010-11-10 22:08:56 UTC (rev 22804)
@@ -37,6 +37,7 @@
import org.cytoscape.equations.AbstractFunction;
import org.cytoscape.equations.ArgDescriptor;
import org.cytoscape.equations.ArgType;
+import org.cytoscape.equations.FunctionUtil;
import org.cytoscape.equations.internal.SUIDToNodeMapper;
import org.cytoscape.session.CyApplicationManager;
@@ -49,7 +50,7 @@
public OutDegree(final SUIDToNodeMapper suidToNodeMapper,
final CyApplicationManager applicationManager)
{
- super(new ArgDescriptor[] { new
ArgDescriptor(ArgType.STRICT_INT, "node_ID", "An ID identifying a node.") });
+ super(new ArgDescriptor[] { new ArgDescriptor(ArgType.INT,
"node_ID", "An ID identifying a node.") });
this.suidToNodeMapper = suidToNodeMapper;
this.applicationManager = applicationManager;
}
@@ -73,7 +74,7 @@
* @return the result of the function evaluation which is the natural
logarithm of the first argument
*/
public Object evaluateFunction(final Object[] args) {
- final Long nodeID = (Long)args[0];
+ final Long nodeID = FunctionUtil.getArgAsLong(args[0]);
final CyNetwork currentNetwork =
applicationManager.getCurrentNetwork();
if (currentNetwork == null)
Modified:
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/SourceID.java
===================================================================
---
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/SourceID.java
2010-11-10 22:05:26 UTC (rev 22803)
+++
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/SourceID.java
2010-11-10 22:08:56 UTC (rev 22804)
@@ -33,6 +33,7 @@
import org.cytoscape.equations.AbstractFunction;
import org.cytoscape.equations.ArgDescriptor;
import org.cytoscape.equations.ArgType;
+import org.cytoscape.equations.FunctionUtil;
import org.cytoscape.equations.internal.SUIDToEdgeMapper;
import org.cytoscape.equations.internal.SUIDToNodeMapper;
@@ -45,7 +46,7 @@
private final SUIDToEdgeMapper suidToEdgeMapper;
public SourceID(final SUIDToEdgeMapper suidToEdgeMapper) {
- super(new ArgDescriptor[] { new
ArgDescriptor(ArgType.STRICT_INT, "edge_ID", "An ID identifying an edge.") });
+ super(new ArgDescriptor[] { new ArgDescriptor(ArgType.INT,
"edge_ID", "An ID identifying an edge.") });
this.suidToEdgeMapper = suidToEdgeMapper;
}
@@ -68,7 +69,7 @@
* @return the result of the function evaluation which is the natural
logarithm of the first argument
*/
public Object evaluateFunction(final Object[] args) {
- final Long edgeID = (Long)args[0];
+ final Long edgeID = FunctionUtil.getArgAsLong(args[0]);
final CyEdge edge = suidToEdgeMapper.getEdge(edgeID);
if (edge == null)
Modified:
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/TargetID.java
===================================================================
---
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/TargetID.java
2010-11-10 22:05:26 UTC (rev 22803)
+++
core3/equations-functions-impl/trunk/src/main/java/org/cytoscape/equations/internal/functions/TargetID.java
2010-11-10 22:08:56 UTC (rev 22804)
@@ -33,6 +33,7 @@
import org.cytoscape.equations.AbstractFunction;
import org.cytoscape.equations.ArgDescriptor;
import org.cytoscape.equations.ArgType;
+import org.cytoscape.equations.FunctionUtil;
import org.cytoscape.equations.internal.SUIDToEdgeMapper;
import org.cytoscape.equations.internal.SUIDToNodeMapper;
@@ -43,7 +44,7 @@
private final SUIDToEdgeMapper suidToEdgeMapper;
public TargetID(final SUIDToEdgeMapper suidToEdgeMapper) {
- super(new ArgDescriptor[] { new
ArgDescriptor(ArgType.STRICT_INT, "edge_ID", "An ID identifying an edge.") });
+ super(new ArgDescriptor[] { new ArgDescriptor(ArgType.INT,
"edge_ID", "An ID identifying an edge.") });
this.suidToEdgeMapper = suidToEdgeMapper;
}
@@ -66,7 +67,7 @@
* @return the result of the function evaluation which is the natural
logarithm of the first argument
*/
public Object evaluateFunction(final Object[] args) {
- final Long edgeID = (Long)args[0];
+ final Long edgeID = FunctionUtil.getArgAsLong(args[0]);
final CyEdge edge = suidToEdgeMapper.getEdge(edgeID);
if (edge == null)
--
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.