Class EquationUtil

  • public final class EquationUtil
    extends Object
    Various static utility methods relating to equations.

    Module: equations-api

    To use this in your app, include the following dependency in your POM:


    Cytoscape Backwards Compatibility (Static Class): This class is static 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 Detail

      • attribNameAsReference

        public static String attribNameAsReference​(String attribName)
        Converts a bare name to a variable reference.
        attribName - the bare name that will be converted
        "attribName" written as an attribute reference with a leading $-sign
      • doubleToLong

        public static long doubleToLong​(double d)
        Checked conversion of a double to a long following the Excel™ rules.
        d - the number that will be converted
        "d" converted to a Long using Excel™ rules
        IllegalArgumentException - if "d" is outside the range of a long
      • refreshEquations

        public static void refreshEquations​(CyTable table,
                                            EquationCompiler compiler)
        Refreshes all the equations in the given CyTable
        table - the CyTable
        compiler - an EquationCompiler
      • eqnTypeIsCompatible

        public static boolean eqnTypeIsCompatible​(Class<?> columnType,
                                                  Class<?> listElementType,
                                                  Class<?> eqnType)
        Returns whether the given column type is compatible with an equation type
        columnType - the column type
        listElementType - the list element type, if columnType is List
        eqnType - the equation type
        true if the types are compatible, false if incompatible
      • getUnqualifiedName

        public static String getUnqualifiedName​(Class<?> type)
        Returns the unqualified name of the given class
        type - a Class object
        the unqualified name of the class as a String