Package ca.uqac.lif.cep.fol
Class Predicate
- java.lang.Object
-
- ca.uqac.lif.cep.functions.Function
-
- ca.uqac.lif.cep.fol.Predicate
-
- All Implemented Interfaces:
ca.uqac.lif.azrael.Printable
,ca.uqac.lif.azrael.Readable
,ca.uqac.lif.cep.Duplicable
,ca.uqac.lif.cep.functions.DuplicableFunction
public class Predicate extends ca.uqac.lif.cep.functions.Function
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Predicate.PredicateArgument
static class
Predicate.Wildcard
Special constant that can be used when evaluating a predicate to indicate a "don't care" value
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]
m_domainNames
The predicate's domain name for each of its argumentsprotected java.lang.String
m_name
The predicate's name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDefinition(Predicate.PredicateArgument arguments, boolean value)
Adds a new tuple to the definition of this predicatevoid
clear()
Predicate
duplicate(boolean with_state)
void
evaluate(java.lang.Object[] inputs, java.lang.Object[] outputs, ca.uqac.lif.cep.Context context, ca.uqac.lif.cep.EventTracker tracker)
java.lang.String[]
getDomainNames()
int
getInputArity()
void
getInputTypesFor(java.util.Set<java.lang.Class<?>> classes, int index)
int
getOutputArity()
java.lang.Class<?>
getOutputTypeFor(int index)
void
reset()
java.lang.String
toString()
void
updateDefinition(PredicateTuple tuple)
void
updateDefinition(java.lang.Object[] inputs, boolean value)
-
-
-
Constructor Detail
-
Predicate
public Predicate(java.lang.String name, java.lang.String... domain_names)
Creates a new predicate- Parameters:
name
- The name of the predicatedomain_names
- The name of the domains for each of its arguments
-
Predicate
public Predicate(Predicate pred)
Creates a new predicate by copying its contents from another predicate- Parameters:
pred
- The predicate to copy from
-
-
Method Detail
-
addDefinition
public void addDefinition(Predicate.PredicateArgument arguments, boolean value)
Adds a new tuple to the definition of this predicate- Parameters:
arguments
- The argumentsvalue
- The value associated to these arguments
-
updateDefinition
public void updateDefinition(java.lang.Object[] inputs, boolean value)
-
updateDefinition
public void updateDefinition(PredicateTuple tuple)
-
getDomainNames
public java.lang.String[] getDomainNames()
-
clear
public void clear()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
evaluate
public void evaluate(java.lang.Object[] inputs, java.lang.Object[] outputs, ca.uqac.lif.cep.Context context, ca.uqac.lif.cep.EventTracker tracker)
- Specified by:
evaluate
in classca.uqac.lif.cep.functions.Function
-
getInputArity
public int getInputArity()
- Specified by:
getInputArity
in classca.uqac.lif.cep.functions.Function
-
getOutputArity
public int getOutputArity()
- Specified by:
getOutputArity
in classca.uqac.lif.cep.functions.Function
-
reset
public void reset()
- Overrides:
reset
in classca.uqac.lif.cep.functions.Function
-
duplicate
public Predicate duplicate(boolean with_state)
- Specified by:
duplicate
in interfaceca.uqac.lif.cep.Duplicable
- Specified by:
duplicate
in classca.uqac.lif.cep.functions.Function
-
getInputTypesFor
public void getInputTypesFor(java.util.Set<java.lang.Class<?>> classes, int index)
- Specified by:
getInputTypesFor
in classca.uqac.lif.cep.functions.Function
-
getOutputTypeFor
public java.lang.Class<?> getOutputTypeFor(int index)
- Specified by:
getOutputTypeFor
in classca.uqac.lif.cep.functions.Function
-
-