Package com.semedy.reasoner.api.builtin
Class CachedConnector
java.lang.Object
com.semedy.reasoner.api.builtin.CachedConnector
- Direct Known Subclasses:
TestMultiRelationalCached
- Author:
- angele
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
clear()
frees up allocated resourcesabstract Builtin
clone the builtinvoid
call back function.abstract String[]
get descriptions for the different argumentsabstract int
getArity()
get the arity of the builtinabstract String
get a description for the builtinabstract String
getName()
get the name of the builtinabstract BuiltinType
getType()
get the type of the builtinabstract long
the weight of the builtin.abstract void
initialize the builtinabstract void
input
(long[] input) Feed the built-in with an input tuple.abstract boolean
isEvaluable
(BitSet grounds, BitSet variableInstantiations, Object[] args) is builtin evaluable with a certain instantiation of variablesabstract boolean
is it a builtin for internal use onlyabstract BitSet
objectGeneratingArguments
(BitSet grounds, BitSet variableInstantiations, Object[] args) In which argument position are new objects createdabstract boolean
does the builtin read the symbol tableabstract void
setProperties
(Properties prp) set the sytem propertiesabstract void
setSymbolTable
(SymbolTable symbolTable) set the symbol tableabstract void
start
(BitSet grounds, BuiltinReceiver receiver) Start feeding the built-in with input values.abstract void
stop()
stop feeding the built-in with input valuesabstract boolean
does the builtin write into the symbol table
-
Constructor Details
-
CachedConnector
public CachedConnector()
-
-
Method Details
-
evaluationFinished
Description copied from interface:Builtin
call back function. Is called when the whole evaluation has been finished- Specified by:
evaluationFinished
in interfaceBuiltin
- Throws:
BuiltinException
InterruptedException
-
isEvaluable
public abstract boolean isEvaluable(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException Description copied from interface:Builtin
is builtin evaluable with a certain instantiation of variables- Specified by:
isEvaluable
in interfaceBuiltin
- Parameters:
grounds
- , which arguments are groundvariableInstantiations
- , which variables are instantiatedargs
- , the arguments- Returns:
- was it evaluable
- Throws:
BuiltinException
-
init
Description copied from interface:Builtin
initialize the builtin -
setSymbolTable
Description copied from interface:Builtin
set the symbol table- Specified by:
setSymbolTable
in interfaceBuiltin
- Parameters:
symbolTable
- , the symbol table
-
setProperties
Description copied from interface:Builtin
set the sytem properties- Specified by:
setProperties
in interfaceBuiltin
- Parameters:
prp
- , properties
-
getWeight
Description copied from interface:Builtin
the weight of the builtin. Determines when the builtin is executed in a rule -
objectGeneratingArguments
public abstract BitSet objectGeneratingArguments(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException Description copied from interface:Builtin
In which argument position are new objects created- Specified by:
objectGeneratingArguments
in interfaceBuiltin
- Parameters:
grounds
- , ground argument positionsvariableInstantiations
- , instantiated variablesargs
- , arguments of the literal- Returns:
- each bit indicates the argument position where new objects are created
- Throws:
BuiltinException
-
getName
Description copied from interface:Builtin
get the name of the builtin -
getArity
public abstract int getArity()Description copied from interface:Builtin
get the arity of the builtin -
getType
Description copied from interface:Builtin
get the type of the builtin -
isInternal
public abstract boolean isInternal()Description copied from interface:Builtin
is it a builtin for internal use only- Specified by:
isInternal
in interfaceBuiltin
- Returns:
-
getArgumentDescriptions
Description copied from interface:Builtin
get descriptions for the different arguments- Specified by:
getArgumentDescriptions
in interfaceBuiltin
- Returns:
- a description of the arguments of the built-in
-
getDescription
Description copied from interface:Builtin
get a description for the builtin- Specified by:
getDescription
in interfaceBuiltin
- Returns:
- a description of the built-in
-
readsSymbolTable
public abstract boolean readsSymbolTable()Description copied from interface:Builtin
does the builtin read the symbol table- Specified by:
readsSymbolTable
in interfaceBuiltin
- Returns:
- true if it reads the symbol table
-
writesSymbolTable
public abstract boolean writesSymbolTable()Description copied from interface:Builtin
does the builtin write into the symbol table- Specified by:
writesSymbolTable
in interfaceBuiltin
- Returns:
- true if it writes to the symbol table
-
cloneBuiltin
Description copied from interface:Builtin
clone the builtin- Specified by:
cloneBuiltin
in interfaceBuiltin
- Returns:
- the cloned built-in
-
clear
public abstract void clear()Description copied from interface:Builtin
frees up allocated resources -
start
public abstract void start(BitSet grounds, BuiltinReceiver receiver) throws ReasoningException, InterruptedException, IOException Description copied from interface:Connector
Start feeding the built-in with input values. Grounds indicates the ground arguments;
receiver catches the results of the evaluation- Specified by:
start
in interfaceConnector
- Parameters:
grounds
- , the arguments which are groundreceiver
- , the receiver receiving the results- Throws:
ReasoningException
InterruptedException
IOException
-
input
public abstract void input(long[] input) Description copied from interface:Connector
Feed the built-in with an input tuple.
The built-in may produce at any time results,
may be during feeding or may be after calling stop -
stop
Description copied from interface:Connector
stop feeding the built-in with input values- Specified by:
stop
in interfaceConnector
- Throws:
SemReasonerException
-