no.sesat
Class Interpreter
java.lang.Object
no.sesat.Interpreter
public class Interpreter
- extends Object
Simple interpreter that will start if a console is available. You can add
functions to it by using addFunction(String, Function).
|
Field Summary |
static boolean |
ENABLED
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ENABLED
public static final boolean ENABLED
Interpreter
public Interpreter()
addFunction
public static void addFunction(String name,
Interpreter.Function fun)
- Add a function to this Interpreter.
- Parameters:
name - Name of functionfun - The function
removeFunction
public static void removeFunction(String name)
- Remove function from interpreter.
- Parameters:
name - Named function
eval
public static String eval(String expr)
- Evaluate the expression
- Parameters:
expr - to be evaluated.
- Returns:
- result
Copyright © 2009 Schibsted Søk AS. All Rights Reserved.