public interface EquationParser
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>
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getDefaultVariableValues()
Returns a map of variable names to their default values, if any.
|
String |
getErrorMsg()
If parse() failed, this will return the last error messages.
|
Function |
getFunction(String functionName)
Returns the function associated with the name "functionName" or null if no such function exists.
|
TreeNode |
getParseTree()
Returns the parse tree.
|
Set<Function> |
getRegisteredFunctions()
Returns the set of currently registered functions.
|
Class<?> |
getType()
Returns the result type of the parsed equation if the parse succeeded, otherwise null.
|
Set<String> |
getVariableReferences()
Returns all the variable names that have been detected in the most recently parsed equation.
|
boolean |
parse(String eqn,
Map<String,Class<?>> attribNameToTypeMap)
Returns true if the parse succeeded otherwise false
|
void |
registerFunction(Function func)
After registering an attribute function "func" it can be used in attribute equations.
|
void registerFunction(Function func) throws IllegalArgumentException
func
- the function that will be registeredIllegalArgumentException
- will be thrown if "func" is null or the function has previously been registeredFunction getFunction(String functionName)
functionName
- the name of the function to get.Set<Function> getRegisteredFunctions()
boolean parse(String eqn, Map<String,Class<?>> attribNameToTypeMap)
eqn
- a valid attribute equation which must start with an equal signattribNameToTypeMap
- a list of existing attribute names and their typesClass<?> getType()
String getErrorMsg()
Set<String> getVariableReferences()
Map<String,Object> getDefaultVariableValues()
TreeNode getParseTree()
Copyright 2011-2015 Cytoscape Consortium. All rights reserved.