Class 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:


    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.
    • Constructor Detail

      • Equation

        public Equation​(String equation,
                        Set<String> variableReferences,
                        Map<String,​Object> defaultVariableValues,
                        Object[] code,
                        int[] sourceLocations,
                        Class<?> type)
        Constructs an Equation.
        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 Detail

      • toString

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

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

        public int hashCode()
        hashCode in class Object
      • getVariableReferences

        public Set<String> getVariableReferences()
        Returns all the variable references that occur as part if this Equation.
        a set of variables referenced by this Equation
      • getDefaultVariableValues

        public Map<String,​Object> getDefaultVariableValues()
        Returns default values for variable references, if any.
        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.
        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.)
        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.
        the type of this