Package org.cytoscape.equations
Class Equation
java.lang.Object
org.cytoscape.equations.Equation
The class representing an equation.
Cytoscape Backwards Compatibility (Final Class): This class is final and therefore can't be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
Module: equations-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>equations-api</artifactId> </dependency>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares oneEquation
to another.Object[]
getCode()
Returns the compiled code (not Java byte code!) for the VM representing thisEquation
.Returns default values for variable references, if any.int[]
Returns the starting points in the original equation for each node in the parse tree that resulted from the original equation.Class<?>
getType()
The overall type of the Equation, e.g.Returns all the variable references that occur as part if thisEquation
.int
hashCode()
toString()
Returns a textual representation of anEquation
.
-
Constructor Details
-
Equation
public Equation(String equation, Set<String> variableReferences, Map<String, Object> defaultVariableValues, Object[] code, int[] sourceLocations, Class<?> type) Constructs anEquation
.- Parameters:
equation
- the string representing this equationvariableReferences
- other variables that are referenced by this equationdefaultVariableValues
-code
- the instruction sequence representing the compiled equationsourceLocations
- the starting points in the original equation for each node in the parse tree that resulted from the original equationtype
- the type of the equation, String.class, Boolean.class or Double.class
-
-
Method Details
-
toString
Returns a textual representation of anEquation
. -
equals
Compares oneEquation
to another. -
hashCode
public int hashCode() -
getVariableReferences
Returns all the variable references that occur as part if thisEquation
.- Returns:
- a set of variables referenced by this
Equation
-
getDefaultVariableValues
Returns default values for variable references, if any.- Returns:
- a map of variable names to their default values, if any
-
getCode
Returns the compiled code (not Java byte code!) for the VM representing thisEquation
.- Returns:
- the code representing this
Equation
-
getSourceLocations
public int[] getSourceLocations()Returns the starting points in the original equation for each node in the parse tree that resulted from the original equation. (Potentially useful for writing a debugger.)- Returns:
- all the starting points in the original equation that resulted in parse tree nodes
-
getType
The overall type of the Equation, e.g. Long.class, String.class etc.- Returns:
- the type of this
-