Package org.cytoscape.equations
Class Equation
- java.lang.Object
-
- org.cytoscape.equations.Equation
-
public final class Equation extends Object
The class representing an equation.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>
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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
Compares oneEquation
to another.Object[]
getCode()
Returns the compiled code (not Java byte code!) for the VM representing thisEquation
.Map<String,Object>
getDefaultVariableValues()
Returns default values for variable references, if any.int[]
getSourceLocations()
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.Set<String>
getVariableReferences()
Returns all the variable references that occur as part if thisEquation
.int
hashCode()
String
toString()
Returns a textual representation of anEquation
.
-
-
-
Constructor Detail
-
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 Detail
-
toString
public String toString()
Returns a textual representation of anEquation
.
-
equals
public boolean equals(Object other)
Compares oneEquation
to another.
-
getVariableReferences
public Set<String> getVariableReferences()
Returns all the variable references that occur as part if thisEquation
.- Returns:
- a set of variables referenced by this
Equation
-
getDefaultVariableValues
public Map<String,Object> getDefaultVariableValues()
Returns default values for variable references, if any.- Returns:
- a map of variable names to their default values, if any
-
getCode
public Object[] 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
public Class<?> getType()
The overall type of the Equation, e.g. Long.class, String.class etc.- Returns:
- the type of this
-
-