LightJason - AgentSpeak(L++)
org.lightjason.agentspeak.action.builtin.bool.CEqual Class Reference

checks elements of equality. More...

+ Inheritance diagram for org.lightjason.agentspeak.action.builtin.bool.CEqual:
+ Collaboration diagram for org.lightjason.agentspeak.action.builtin.bool.CEqual:

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...
 

Protected Member Functions

boolean apply (final boolean p_value)
 apply to change boolean result More...
 
- Protected Member Functions inherited from org.lightjason.agentspeak.action.builtin.IBuiltinAction
 IBuiltinAction ()
 ctor More...
 
 IBuiltinAction (final int p_length)
 ctor More...
 

Private Member Functions

IFuzzyValue< Boolean > pack ( @Nonnull final List< ITerm > p_return, @Nonnull final Stream< Boolean > p_stream)
 pack the result values into term More...
 

Static Private Member Functions

static boolean equalcollection ( @Nonnull final Object[] p_source, @Nonnull final Collection<?> p_target)
 compares collections More...
 
static boolean equalmap ( @Nonnull final Map<?, ?> p_source, @Nonnull final Map<?, ?> p_target)
 compare maps More...
 
static boolean equalmultimap ( @Nonnull final Multimap<?, ?> p_source, @Nonnull final Multimap<?, ?> p_target)
 compare multimap More...
 
static boolean equalobject ( @Nonnull final Object p_source, @Nonnull final Object p_target)
 compare any objects More...
 

Static Private Attributes

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

Additional Inherited Members

- Public Attributes inherited from org.lightjason.agentspeak.action.IAction
long serialVersionUID = -6374480398439703170L
 serial id 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 actions checks the first argument to all others arguments of equality, list structures won't be unflaten, but elementwise compared, the action never fails. On number arguments not the value must equal, also the type (double / integral) must be equal, so keep in mind, that you use the correct number type on the argument input

[E1|E2] = bool/equal( "this is equal", "this is equal", [123, "test"] );

Definition at line 55 of file CEqual.java.

Member Function Documentation

◆ apply()

boolean org.lightjason.agentspeak.action.builtin.bool.CEqual.apply ( final boolean  p_value)
protected
Parameters
p_valueboolean result
Returns
boolean value

Definition at line 124 of file CEqual.java.

◆ equalcollection()

static boolean org.lightjason.agentspeak.action.builtin.bool.CEqual.equalcollection ( @Nonnull final Object []  p_source,
@Nonnull final Collection<?>  p_target 
)
staticprivate
Parameters
p_sourcesource array (converted collection to array)
p_targetcollection to compare
Returns
equality boolean flag

Definition at line 166 of file CEqual.java.

Referenced by org.lightjason.agentspeak.action.builtin.bool.CEqual.execute().

+ Here is the caller graph for this function:

◆ equalmap()

static boolean org.lightjason.agentspeak.action.builtin.bool.CEqual.equalmap ( @Nonnull final Map<?, ?>  p_source,
@Nonnull final Map<?, ?>  p_target 
)
staticprivate
Parameters
p_sourcesource map
p_targetmap to compare
Returns
equality boolean flag

Definition at line 179 of file CEqual.java.

Referenced by org.lightjason.agentspeak.action.builtin.bool.CEqual.execute().

+ Here is the caller graph for this function:

◆ equalmultimap()

static boolean org.lightjason.agentspeak.action.builtin.bool.CEqual.equalmultimap ( @Nonnull final Multimap<?, ?>  p_source,
@Nonnull final Multimap<?, ?>  p_target 
)
staticprivate
Parameters
p_sourcesource multimap
p_targetmultimap to compare
Returns
equality boolean flag

Definition at line 193 of file CEqual.java.

Referenced by org.lightjason.agentspeak.action.builtin.bool.CEqual.execute().

+ Here is the caller graph for this function:

◆ equalobject()

static boolean org.lightjason.agentspeak.action.builtin.bool.CEqual.equalobject ( @Nonnull final Object  p_source,
@Nonnull final Object  p_target 
)
staticprivate
Parameters
p_sourcesource object
p_targetobject to compare
Returns
equality boolean flag

Definition at line 153 of file CEqual.java.

Referenced by org.lightjason.agentspeak.action.builtin.bool.CEqual.execute().

+ Here is the caller graph for this function:

◆ execute()

final IFuzzyValue<Boolean> org.lightjason.agentspeak.action.builtin.bool.CEqual.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 71 of file CEqual.java.

References org.lightjason.agentspeak.action.builtin.bool.CEqual.equalcollection(), org.lightjason.agentspeak.action.builtin.bool.CEqual.equalmap(), org.lightjason.agentspeak.action.builtin.bool.CEqual.equalmultimap(), org.lightjason.agentspeak.action.builtin.bool.CEqual.equalobject(), org.lightjason.agentspeak.action.builtin.bool.CEqual.pack(), and org.lightjason.agentspeak.language.CCommon.rawvalueAssignableTo().

Referenced by org.lightjason.agentspeak.action.builtin.TestCActionBool.equal(), and org.lightjason.agentspeak.action.builtin.TestCActionBool.notequal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ minimalArgumentNumber()

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

Implements org.lightjason.agentspeak.action.IAction.

Definition at line 64 of file CEqual.java.

◆ pack()

IFuzzyValue<Boolean> org.lightjason.agentspeak.action.builtin.bool.CEqual.pack ( @Nonnull final List< ITerm p_return,
@Nonnull final Stream< Boolean >  p_stream 
)
private
Parameters
p_returnreturn item list
p_streamboolean input stream
Returns
boolean flag

Definition at line 137 of file CEqual.java.

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

Referenced by org.lightjason.agentspeak.action.builtin.bool.CEqual.execute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ serialVersionUID

final long org.lightjason.agentspeak.action.builtin.bool.CEqual.serialVersionUID = -2953614515361905328L
staticprivate

Definition at line 60 of file CEqual.java.