Cytoscape 3.0.1 API

org.cytoscape.equations
Interface EquationParser


public interface EquationParser

Parser for a string representing an equation.


Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.

Method Summary
 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.
 

Method Detail

registerFunction

void registerFunction(Function func)
                      throws IllegalArgumentException
After registering an attribute function "func" it can be used in attribute equations.

Parameters:
func - the function that will be registered
Throws:
IllegalArgumentException - will be thrown if "func" is null or the function has previously been registered

getFunction

Function getFunction(String functionName)
Returns the function associated with the name "functionName" or null if no such function exists.

Parameters:
functionName - the name of the function to get.
Returns:
the function associated with the name "functionName" or null if no such function exists.

getRegisteredFunctions

Set<Function> getRegisteredFunctions()
Returns the set of currently registered functions.

Returns:
the set of currently registered functions

parse

boolean parse(String eqn,
              Map<String,Class<?>> attribNameToTypeMap)
Returns true if the parse succeeded otherwise false

Parameters:
eqn - a valid attribute equation which must start with an equal sign
attribNameToTypeMap - a list of existing attribute names and their types
Returns:
true if the parse succeeded otherwise false

getType

Class<?> getType()
Returns the result type of the parsed equation if the parse succeeded, otherwise null.

Returns:
the result type of the parsed equation if the parse succeeded, otherwise null.

getErrorMsg

String getErrorMsg()
If parse() failed, this will return the last error messages.

Returns:
the last error message of null

getVariableReferences

Set<String> getVariableReferences()
Returns all the variable names that have been detected in the most recently parsed equation.

Returns:
all the variable names that have been detected in the most recently parsed equation.

getDefaultVariableValues

Map<String,Object> getDefaultVariableValues()
Returns a map of variable names to their default values, if any.

Returns:
a map of variable names to their default values, if any.

getParseTree

TreeNode getParseTree()
Returns the parse tree. Must only be called if parse() returns true!

Returns:
the parse tree.

Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.