Package org.cytoscape.equations
Class EquationUtil
- java.lang.Object
-
- org.cytoscape.equations.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:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>equations-api</artifactId> </dependency>
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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
attribNameAsReference(String attribName)
Converts a bare name to a variable reference.static long
doubleToLong(double d)
Checked conversion of a double to a long following the Excel™ rules.static boolean
eqnTypeIsCompatible(Class<?> columnType, Class<?> listElementType, Class<?> eqnType)
Returns whether the given column type is compatible with an equation typestatic String
getUnqualifiedName(Class<?> type)
Returns the unqualified name of the given classstatic void
refreshEquations(CyTable table, EquationCompiler compiler)
Refreshes all the equations in the given CyTable
-
-
-
Method Detail
-
attribNameAsReference
public static String attribNameAsReference(String attribName)
Converts a bare name to a variable reference.- Parameters:
attribName
- the bare name that will be converted- Returns:
- "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.- Parameters:
d
- the number that will be converted- Returns:
- "d" converted to a Long using Excel™ rules
- Throws:
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- Parameters:
table
- the CyTablecompiler
- 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- Parameters:
columnType
- the column typelistElementType
- the list element type, if columnType is ListeqnType
- the equation type- Returns:
- true if the types are compatible, false if incompatible
-
-