Class Equation

java.lang.Object
org.cytoscape.equations.Equation

public final class Equation extends Object
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 Details

    • Equation

      public Equation(String equation, Set<String> variableReferences, Map<String,Object> defaultVariableValues, Object[] code, int[] sourceLocations, Class<?> type)
      Constructs an Equation.
      Parameters:
      equation - the string representing this equation
      variableReferences - other variables that are referenced by this equation
      defaultVariableValues -
      code - the instruction sequence representing the compiled equation
      sourceLocations - the starting points in the original equation for each node in the parse tree that resulted from the original equation
      type - the type of the equation, String.class, Boolean.class or Double.class
  • Method Details

    • toString

      public String toString()
      Returns a textual representation of an Equation.
      Overrides:
      toString in class Object
      Returns:
      this Equation as a String
    • equals

      public boolean equals(Object other)
      Compares one Equation to another.
      Overrides:
      equals in class Object
      Returns:
      true if this Equation is equivalent to "other" and else returns false
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getVariableReferences

      public Set<String> getVariableReferences()
      Returns all the variable references that occur as part if this Equation.
      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 this Equation.
      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