Search in sources :

Example 6 with FunctionType

use of cbit.vcell.parser.ASTFuncNode.FunctionType in project vcell by virtualcell.

the class SolverUtilities method getSizeFunctionInvocations.

public static Set<FunctionInvocation> getSizeFunctionInvocations(Expression expression) {
    if (expression == null) {
        return null;
    }
    FunctionInvocation[] functionInvocations = expression.getFunctionInvocations(new FunctionFilter() {

        @Override
        public boolean accept(String functionName, FunctionType functionType) {
            if (functionName.equals(MathFunctionDefinitions.Function_regionArea_current.getFunctionName()) || functionName.equals(MathFunctionDefinitions.Function_regionVolume_current.getFunctionName())) {
                return true;
            }
            return false;
        }
    });
    Set<FunctionInvocation> fiSet = new HashSet<FunctionInvocation>();
    for (FunctionInvocation fi : functionInvocations) {
        fiSet.add(fi);
    }
    return fiSet;
}
Also used : FunctionInvocation(cbit.vcell.parser.FunctionInvocation) FunctionFilter(cbit.vcell.parser.Expression.FunctionFilter) FunctionType(cbit.vcell.parser.ASTFuncNode.FunctionType) HashSet(java.util.HashSet)

Aggregations

FunctionType (cbit.vcell.parser.ASTFuncNode.FunctionType)6 FunctionInvocation (cbit.vcell.parser.FunctionInvocation)5 Expression (cbit.vcell.parser.Expression)4 FunctionFilter (cbit.vcell.parser.Expression.FunctionFilter)4 ExpressionException (cbit.vcell.parser.ExpressionException)3 SymbolTableEntry (cbit.vcell.parser.SymbolTableEntry)3 ExpressionBindingException (cbit.vcell.parser.ExpressionBindingException)2 SymbolTableFunctionEntry (cbit.vcell.parser.SymbolTableFunctionEntry)2 MathException (cbit.vcell.math.MathException)1 MatrixException (cbit.vcell.matrix.MatrixException)1 ModelFunction (cbit.vcell.model.Model.ModelFunction)1 ModelException (cbit.vcell.model.ModelException)1 VCUnitEvaluator (cbit.vcell.parser.VCUnitEvaluator)1 VCUnitDefinition (cbit.vcell.units.VCUnitDefinition)1 VCUnitException (cbit.vcell.units.VCUnitException)1 Font (java.awt.Font)1 PropertyVetoException (java.beans.PropertyVetoException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 BoxLayout (javax.swing.BoxLayout)1