public boolean evaluateNodeLogical(final ASTNode node) { if (node instanceof FunctionNode) { return evaluateFunctionLogical((FunctionNode) node); } if (node instanceof SymbolNode) { BooleanVariable v = fBooleanVariables.get(node.toString()); if (v != null) { return v.getValue(); } Boolean boole = SYMBOL_BOOLEAN_MAP.get(node.toString()); if (boole != null) { return boole.booleanValue(); } } throw new ArithmeticException("EvalDouble#evaluateNodeLogical(ASTNode) not possible for: " + node.toString()); }
public String toString() { final StringBuffer buff = new StringBuffer(); if (fSymbol != null) { buff.append(fSymbol.toString()); } buff.append('_'); if (fDefault) { buff.append('.'); } if (fConstraint != null) { buff.append(fConstraint.toString()); } return buff.toString(); }
public boolean evaluateNodeLogical(final ASTNode node) { if (node instanceof FunctionNode) { return evaluateFunctionLogical((FunctionNode) node); } if (node instanceof SymbolNode) { BooleanVariable v = fBooleanVariables.get(node.toString()); if (v != null) { return v.getValue(); } Boolean boole = SYMBOL_BOOLEAN_MAP.get(node.toString()); if (boole != null) { return boole.booleanValue(); } } throw new ArithmeticException( "EvalDouble#evaluateNodeLogical(ASTNode) not possible for: " + node.toString()); }
public String toString() { final StringBuffer buff = new StringBuffer(); if (fSymbol != null) { buff.append(fSymbol.toString()); } buff.append("___"); if (fDefault) { buff.append('.'); } if (fConstraint != null) { buff.append(fConstraint.toString()); } return buff.toString(); }
public String toString() { final StringBuffer buff = new StringBuffer(); if (fSymbol != null) { buff.append(fSymbol.toString()); } buff.append("__"); if (fDefault) { buff.append('.'); } if (fConstraint != null) { buff.append(fConstraint.toString()); } return buff.toString(); }
@Override public String toString() { final StringBuilder buff = new StringBuilder(); if (fSymbol != null) { buff.append(fSymbol.toString()); } buff.append('_'); if (fDefault) { buff.append('.'); } if (fConstraint != null) { buff.append(fConstraint.toString()); } return buff.toString(); }
/** * Evaluate node logical. * * @param node the node * @return a boolean. */ public boolean evaluateNodeLogical( final ASTNode node ) { if ( node instanceof FunctionNode ) { return evaluateFunctionLogical( (FunctionNode) node ); } if ( node instanceof SymbolNode ) { BooleanVariable v = fBooleanVariables.get( node.toString() ); if ( v != null ) { return v.getValue(); } Boolean boole = SYMBOL_BOOLEAN_MAP.get( node.toString() ); if ( boole != null ) { return boole.booleanValue(); } } throw new ArithmeticException( "EvalDouble#evaluateNodeLogical(ASTNode) not possible for: " + node.toString() ); }
/** * Evaluate node logical. * * @param node the node * @return a boolean. */ public boolean evaluateNodeLogical( final ASTNode node ) { if ( node instanceof FunctionNode ) { return evaluateFunctionLogical( (FunctionNode) node ); } if ( node instanceof SymbolNode ) { BooleanVariable v = fBooleanVariables.get( node.toString() ); if ( v != null ) { return v.getValue(); } Boolean boole = SYMBOL_BOOLEAN_MAP.get( node.toString() ); if ( boole != null ) { return boole.booleanValue(); } } throw new ArithmeticException( "EvalDouble#evaluateNodeLogical(ASTNode) not possible for: " + node.toString() ); }
public boolean evaluateNodeLogical(final ASTNode node) { if (node instanceof FunctionNode) { return evaluateFunctionLogical((FunctionNode) node); } if (node instanceof SymbolNode) { BooleanVariable v = fBooleanVariables.get(node.toString()); if (v != null) { return v.getValue(); } Boolean boole = SYMBOL_BOOLEAN_MAP.get(node.toString()); if (boole != null) { return boole.booleanValue(); } } throw new ArithmeticMathException( "EvalDouble#evaluateNodeLogical(ASTNode) not possible for: " + node.toString()); }
@Override public String toString() { final StringBuilder buff = new StringBuilder(); if (fSymbol != null) { buff.append(fSymbol.toString()); } buff.append("__"); if (fDefault) { buff.append('.'); } if (fConstraint != null) { buff.append(fConstraint.toString()); } return buff.toString(); } }
@Override public String toString() { final StringBuilder buff = new StringBuilder(); if (fSymbol != null) { buff.append(fSymbol.toString()); } buff.append("___"); if (fDefault) { buff.append('.'); } if (fConstraint != null) { buff.append(fConstraint.toString()); } return buff.toString(); } }
/** * To string. * * @return the string */ @Override public String toString() { final StringBuffer buff = new StringBuffer(); if ( fSymbol != null ) { buff.append( fSymbol.toString() ); } buff.append( "_" ); if ( fConstraint != null ) { buff.append( fConstraint.toString() ); } return buff.toString(); }
public String toString() { ASTNode temp = fNodesList.get(0); final StringBuffer buf = new StringBuffer(); if (temp == null) { buf.append("<null-tag>"); } else { buf.append(temp.toString()); } buf.append('['); for (int i = 1; i < size(); i++) { temp = get(i); buf.append(temp == this ? "(this ListNode)" : String.valueOf(temp)); if (i < size() - 1) { buf.append(", "); } } buf.append(']'); return buf.toString(); }
/** * To string. * * @return the string */ @Override public String toString() { ASTNode temp = fNodesList.get( 0 ); final StringBuffer buf = new StringBuffer(); if ( temp == null ) { buf.append( "<null-tag>" ); } else { buf.append( temp.toString() ); } buf.append( "[" ); for ( int i = 1; i < size(); i++ ) { temp = get( i ); buf.append( temp == this ? "(this ListNode)" : String.valueOf( temp ) ); if ( i < size() - 1 ) { buf.append( ", " ); } } buf.append( "]" ); return buf.toString(); }
/** * Get the variable names from the given AST node. * * @param node * an already parsed AST node * @param result * a set which contains the variable names */ public static void getVariables(final ASTNode node, Set<String> result) { if (node instanceof FunctionNode) { FunctionNode functionNode = (FunctionNode) node; if (functionNode.size() > 0 && functionNode.getNode(0) instanceof SymbolNode) { for (int i = 1; i < functionNode.size(); i++) { getVariables(functionNode.getNode(i), result); } } } if (node instanceof SymbolNode) { Object obj = SYMBOL_DOUBLE_MAP.get(node.toString()); if (obj == null) { obj = SYMBOL_BOOLEAN_MAP.get(node.toString()); if (obj == null) { result.add(node.toString()); } } } } }
/** * Get the variable names from the given AST node. * * @param node an already parsed AST node * @param result a set which contains the variable names */ public static void getVariables( final ASTNode node, Set<String> result ) { if ( node instanceof FunctionNode ) { FunctionNode functionNode = (FunctionNode) node; if ( functionNode.size() > 0 && functionNode.getNode( 0 ) instanceof SymbolNode ) { for ( int i = 1; i < functionNode.size(); i++ ) { getVariables( functionNode.getNode( i ), result ); } } } if ( node instanceof SymbolNode ) { Object obj = SYMBOL_DOUBLE_MAP.get( node.toString() ); if ( obj == null ) { obj = SYMBOL_BOOLEAN_MAP.get( node.toString() ); if ( obj == null ) { result.add( node.toString() ); } } } } }
public boolean evaluateFunctionLogical(final FunctionNode functionNode) { if (functionNode.size() > 0 && functionNode.getNode(0) instanceof SymbolNode) { String symbol = functionNode.getNode(0).toString(); if (functionNode.size() == 2) { Object obj = FUNCTION_BOOLEAN_MAP.get(symbol);
public boolean evaluateFunctionLogical(final FunctionNode functionNode) { if (functionNode.size() > 0 && functionNode.getNode(0) instanceof SymbolNode) { String symbol = functionNode.getNode(0).toString(); if (functionNode.size() == 2) { Object obj = FUNCTION_BOOLEAN_MAP.get(symbol); if (obj instanceof IBooleanBoolean1Function) { return ((IBooleanBoolean1Function) obj).evaluate(evaluateNodeLogical(functionNode.getNode(1))); } } else if (functionNode.size() == 3) { Object obj = FUNCTION_BOOLEAN_MAP.get(symbol); if (obj instanceof IBooleanComplex2Function) { return ((IBooleanComplex2Function) obj).evaluate(evaluateNode(functionNode.getNode(1)), evaluateNode(functionNode.getNode(2))); } else if (obj instanceof IBooleanBoolean2Function) { return ((IBooleanBoolean2Function) obj).evaluate(evaluateNodeLogical(functionNode.getNode(1)), evaluateNodeLogical(functionNode.getNode(2))); } // } else { // Object obj = FUNCTION_BOOLEAN_MAP.get(symbol); // if (obj instanceof IBooleanDoubleFunction) { // return ((IBooleanDoubleFunction) obj).evaluate(this, functionNode); // } } } throw new ArithmeticException("EvalDouble#evaluateFunctionLogical(FunctionNode) not possible for: " + functionNode.toString()); }
public boolean evaluateFunctionLogical(final FunctionNode functionNode) { if (functionNode.size() > 0 && functionNode.getNode(0) instanceof SymbolNode) { String symbol = functionNode.getNode(0).toString(); if (functionNode.size() == 2) { Object obj = FUNCTION_BOOLEAN_MAP.get(symbol); if (obj instanceof IBooleanBoolean1Function) { return ((IBooleanBoolean1Function) obj).evaluate(evaluateNodeLogical(functionNode.getNode(1))); } } else if (functionNode.size() == 3) { Object obj = FUNCTION_BOOLEAN_MAP.get(symbol); if (obj instanceof IBooleanDouble2Function) { return ((IBooleanDouble2Function) obj).evaluate(evaluateNode(functionNode.getNode(1)), evaluateNode(functionNode.getNode(2))); } else if (obj instanceof IBooleanBoolean2Function) { return ((IBooleanBoolean2Function) obj).evaluate(evaluateNodeLogical(functionNode.getNode(1)), evaluateNodeLogical(functionNode.getNode(2))); } // } else { // Object obj = FUNCTION_BOOLEAN_MAP.get(symbol); // if (obj instanceof IBooleanDoubleFunction) { // return ((IBooleanDoubleFunction) obj).evaluate(this, // functionNode); // } } } throw new ArithmeticMathException( "EvalDouble#evaluateFunctionLogical(FunctionNode) not possible for: " + functionNode.toString()); }