public class AutoReply
extends java.lang.Object
Constructor and Description |
---|
AutoReply(java.lang.Object theReply)
Create a new instance of AutoReply.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
evaluate(java.lang.Object filter,
org.ai_heuristic.eval.Condition function,
ObjectsMap objectsMap)
Check the reply based on any filter query or function, which can be a simple description, such as
the default set programmed into the licas script.
|
public AutoReply(java.lang.Object theReply)
theReply
- the reply object to evaluate.protected boolean evaluate(java.lang.Object filter, org.ai_heuristic.eval.Condition function, ObjectsMap objectsMap) throws java.lang.Exception
1. If filter and function are null
, then return true. If either are not null,
then try to evaluate that.
2. If filter is an Element, then try a metadata structure
match.
3. If filter is Boolean, then try a true/false match, as for the function.
4. If filter is any other Object, try an Object.Equals
with the reply.
5. If function can be cast to a Boolean, then:
5.1 If true, a not null
reply is true, otherwise it is false.
5.2 If false, a null
reply is true, otherwise it is false.
6 Otherwise compare the function condition with the result object for true result.
filter
- to filter the method result first, with a matching query or other.function
- a function on the filtered result to satisfy, typically true.objectsMap
- mapping of variable keys to instance value.java.lang.Exception
- any error.