Package org.evrete
Class AbstractRule
- java.lang.Object
-
- org.evrete.AbstractRule
-
- All Implemented Interfaces:
Environment,FluentEnvironment<Rule>,Named,NamedType.Resolver,Rule
public abstract class AbstractRule extends Object implements Rule
-
-
Field Summary
Fields Modifier and Type Field Description static intNULL_SALIENCEprotected Consumer<RhsContext>rhs
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRule(String name)protectedAbstractRule(AbstractRule other, String ruleName, int salience)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchainRhs(Consumer<RhsContext> consumer)<T> Tget(String property)StringgetLiteralRhs()StringgetName()Collection<String>getPropertyNames()Consumer<RhsContext>getRhs()intgetSalience()Ruleset(String property, Object value)voidsetName(String name)voidsetRhs(String literalRhs)voidsetRhs(Consumer<RhsContext> rhs)voidsetSalience(int salience)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.evrete.api.Environment
get
-
Methods inherited from interface org.evrete.api.NamedType.Resolver
getDeclaredFactTypes, resolve
-
-
-
-
Field Detail
-
NULL_SALIENCE
public static final int NULL_SALIENCE
- See Also:
- Constant Field Values
-
rhs
protected Consumer<RhsContext> rhs
-
-
Constructor Detail
-
AbstractRule
protected AbstractRule(String name)
-
AbstractRule
protected AbstractRule(AbstractRule other, String ruleName, int salience)
-
-
Method Detail
-
getRhs
public Consumer<RhsContext> getRhs()
-
setRhs
public void setRhs(Consumer<RhsContext> rhs)
-
getPropertyNames
public Collection<String> getPropertyNames()
- Specified by:
getPropertyNamesin interfaceEnvironment
-
getLiteralRhs
public String getLiteralRhs()
-
getSalience
public final int getSalience()
- Specified by:
getSaliencein interfaceRule
-
setSalience
public void setSalience(int salience)
- Specified by:
setSaliencein interfaceRule
-
set
public Rule set(String property, Object value)
- Specified by:
setin interfaceEnvironment- Specified by:
setin interfaceFluentEnvironment<Rule>
-
get
public final <T> T get(String property)
- Specified by:
getin interfaceEnvironment
-
chainRhs
public void chainRhs(Consumer<RhsContext> consumer)
-
-