LightJason - AgentSpeak(L++)
org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder Class Reference

placeholder rule to define correct rule referencing More...

+ Inheritance diagram for org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder:
+ Collaboration diagram for org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder:

Public Member Functions

 CRulePlaceholder (final ILiteral p_id)
 ctor More...
 
final boolean equals (final Object p_object)
 
IFuzzyValue< Boolean > execute (final boolean p_parallel, @Nonnull final IContext p_context, @Nonnull final List< ITerm > p_argument, @Nonnull final List< ITerm > p_return)
 defines a plan-body operation More...
 
final int hashCode ()
 
final ILiteral identifier ()
 returns the identifier of the rule More...
 
final IContext instantiate ( @Nonnull final IAgent<?> p_agent, @Nonnull final Stream< IVariable<?>> p_variable)
 creates an individual execution context More...
 
final IRule replaceplaceholder ( @Nonnull final Multimap< IPath, IRule > p_rules)
 replaces all placeholder objects and reinstantiate object More...
 
final String toString ()
 
final Stream< IVariable<?> > variables ()
 returns a stream with all used variables More...
 

Private Attributes

final ILiteral m_id
 identifier of the rule More...
 

Static Private Attributes

static final long serialVersionUID = 6857304030640970668L
 serial id More...
 

Additional Inherited Members

- Public Attributes inherited from org.lightjason.agentspeak.language.instantiable.rule.IRule
IRule EMPTY
 empty rule More...
 

Detailed Description

Note
rules are the first executable elements which are parsed, so if a rule calls itself (recursive) the reference does not exists, with this class a placeholder is used first and after that we replace the placeholder with the correct rule object

Definition at line 51 of file CRulePlaceholder.java.

Constructor & Destructor Documentation

◆ CRulePlaceholder()

org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.CRulePlaceholder ( final ILiteral  p_id)
Parameters
p_idrule literal

Definition at line 67 of file CRulePlaceholder.java.

Member Function Documentation

◆ equals()

final boolean org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.equals ( final Object  p_object)

Definition at line 117 of file CRulePlaceholder.java.

References org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.hashCode().

+ Here is the call graph for this function:

◆ execute()

IFuzzyValue<Boolean> org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.execute ( final boolean  p_parallel,
@Nonnull final IContext  p_context,
@Nonnull final List< ITerm p_argument,
@Nonnull final List< ITerm p_return 
)
Parameters
p_parallelparallel execution
p_contextcurrent execution context
p_argumentparameter of the action
p_returnreturn values
Returns
fuzzy boolean

Implements org.lightjason.agentspeak.language.execution.IExecution.

Definition at line 96 of file CRulePlaceholder.java.

References org.lightjason.agentspeak.language.fuzzy.CFuzzyValue< T >.from().

+ Here is the call graph for this function:

◆ hashCode()

final int org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.hashCode ( )

Definition at line 111 of file CRulePlaceholder.java.

Referenced by org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.equals().

+ Here is the caller graph for this function:

◆ identifier()

final ILiteral org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.identifier ( )

◆ instantiate()

final IContext org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.instantiate ( @Nonnull final IAgent<?>  p_agent,
@Nonnull final Stream< IVariable<?>>  p_variable 
)
Parameters
p_agentagent
p_variablevariable stream
Returns
individual context

Implements org.lightjason.agentspeak.language.instantiable.IInstantiable.

Definition at line 89 of file CRulePlaceholder.java.

References org.lightjason.agentspeak.language.CCommon.instantiate().

+ Here is the call graph for this function:

◆ replaceplaceholder()

final IRule org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.replaceplaceholder ( @Nonnull final Multimap< IPath, IRule p_rules)
Parameters
p_rulesfull instantiated rules
Returns
new object instance without placeholders

Implements org.lightjason.agentspeak.language.instantiable.rule.IRule.

Definition at line 82 of file CRulePlaceholder.java.

◆ toString()

final String org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.toString ( )

◆ variables()

final Stream<IVariable<?> > org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.variables ( )
Returns
variable stream (variables will be cloned on instantiation)

Implements org.lightjason.agentspeak.language.execution.IExecution.

Definition at line 105 of file CRulePlaceholder.java.

Member Data Documentation

◆ m_id

final ILiteral org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.m_id
private

◆ serialVersionUID

final long org.lightjason.agentspeak.language.instantiable.rule.CRulePlaceholder.serialVersionUID = 6857304030640970668L
staticprivate

Definition at line 56 of file CRulePlaceholder.java.