org.algernon.lang.shell
Class GenericUnixShellEvaluator
java.lang.Object
org.algernon.lang.shell.GenericUnixShellEvaluator
- All Implemented Interfaces:
- ExternalLanguageEvaluator
- public class GenericUnixShellEvaluator
- extends Object
- implements ExternalLanguageEvaluator
Evaluator for java method calls and expressions.
User: hewett
Date: Dec 10, 2002
Time: 4:30:06 PM
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericUnixShellEvaluator
public GenericUnixShellEvaluator()
toBoolean
public Boolean toBoolean(Object any,
Algernon algy)
- This method must return a Java Boolean value for any
type of Object returned by the evaluateExpression method.
For example, null might correspond to Boolean.False,
- Specified by:
toBoolean
in interface ExternalLanguageEvaluator
- Parameters:
any
- any Java Object, including null.
- Returns:
- a Java Boolean instance.
evaluateExpression
public Object evaluateExpression(LispValue expression,
Algernon algy)
- Makes a call to the UNIX shell.
If the caller returns 0, that typically indicates success.
(:TEST (:SHELL "ls -l | myTest"))
- Specified by:
evaluateExpression
in interface ExternalLanguageEvaluator
- Parameters:
expression
- A valid UNIX command line expression.
- Returns:
- whatever the call returned, turned into a Java Object.