LightJason - AgentSpeak(L++)
org.lightjason.agentspeak.action.builtin.string.CReplace Class Reference

action to replace all occurence within a string. More...

+ Inheritance diagram for org.lightjason.agentspeak.action.builtin.string.CReplace:
+ Collaboration diagram for org.lightjason.agentspeak.action.builtin.string.CReplace:

Public Member Functions

final 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 minimalArgumentNumber ()
 minimum number of arguments More...
 
- Public Member Functions inherited from org.lightjason.agentspeak.action.builtin.IBuiltinAction
final IPath name ()
 returns the name with path of the action More...
 
- Public Member Functions inherited from org.lightjason.agentspeak.action.IBaseAction
final boolean equals (final Object p_object)
 
final int hashCode ()
 
final String toString ()
 
- Public Member Functions inherited from org.lightjason.agentspeak.action.IAction
default Stream< IVariable<?> > variables ()
 returns a stream with all used variables More...
 

Static Private Attributes

static final long serialVersionUID = -5445088831145525666L
 serial id More...
 

Additional Inherited Members

- Public Attributes inherited from org.lightjason.agentspeak.action.IAction
long serialVersionUID = -6374480398439703170L
 serial id More...
 
- Protected Member Functions inherited from org.lightjason.agentspeak.action.builtin.IBuiltinAction
 IBuiltinAction ()
 ctor More...
 
 IBuiltinAction (final int p_length)
 ctor More...
 
- Static Protected Attributes inherited from org.lightjason.agentspeak.action.builtin.IBuiltinAction
static final Logger LOGGER = CCommon.logger( IBuiltinAction.class )
 logger More...
 
- Static Protected Attributes inherited from org.lightjason.agentspeak.action.IBaseAction
static final Logger LOGGER = org.lightjason.agentspeak.common.CCommon.logger( IAction.class )
 logger More...
 

Detailed Description

The action replaces the first argument with the second argument on each string beginning at the third argument and returns all replaced strings, the action never fails. The first argument of the action be defined as a regular expression

[A|B] = string/replace( "search", "replace with", "this is a search string", "this is another string" );
See also
https://en.wikipedia.org/wiki/Regular_expression

Definition at line 49 of file CReplace.java.

Member Function Documentation

◆ execute()

final IFuzzyValue<Boolean> org.lightjason.agentspeak.action.builtin.string.CReplace.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 65 of file CReplace.java.

References org.lightjason.agentspeak.language.CCommon.flatten(), org.lightjason.agentspeak.language.CRawTerm< T >.from(), and org.lightjason.agentspeak.language.fuzzy.CFuzzyValue< T >.from().

+ Here is the call graph for this function:

◆ minimalArgumentNumber()

final int org.lightjason.agentspeak.action.builtin.string.CReplace.minimalArgumentNumber ( )
Returns
number of minimal arguments

Implements org.lightjason.agentspeak.action.IAction.

Definition at line 58 of file CReplace.java.

Member Data Documentation

◆ serialVersionUID

final long org.lightjason.agentspeak.action.builtin.string.CReplace.serialVersionUID = -5445088831145525666L
staticprivate

Definition at line 54 of file CReplace.java.