Package org.cytoscape.equations
Class EquationUtil
java.lang.Object
org.cytoscape.equations.EquationUtil
Various static utility methods relating to equations.
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.
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>
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
attribNameAsReference
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
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
-
getUnqualifiedName
Returns the unqualified name of the given class- Parameters:
type
- a Class object- Returns:
- the unqualified name of the class as a String
-