24 package org.lightjason.agentspeak.language.execution.expression;
32 import javax.annotation.Nonnull;
33 import java.text.MessageFormat;
34 import java.util.Collections;
35 import java.util.List;
36 import java.util.stream.Stream;
72 if ( !p_operator.isBinary() )
75 m_operator = p_operator;
76 m_lefthandside = p_lefthandside;
77 m_righthandside = p_righthandside;
90 @Nonnull
final List<ITerm> p_argument
91 )
throws IllegalArgumentException
94 if ( ( !m_lefthandside.
execute( p_parallel, p_context, Collections.<
ITerm>emptyList(), p_argument ).value() )
95 || ( p_argument.isEmpty() ) )
98 if ( ( !m_righthandside.
execute( p_parallel, p_context, Collections.<
ITerm>emptyList(), p_argument ).value() )
99 || ( p_argument.isEmpty() ) )
102 if ( p_argument.size() != 2 )
133 return m_lefthandside.hashCode() ^ m_righthandside.hashCode() ^ m_operator.hashCode();
137 public final boolean equals(
final Object p_object )
145 return MessageFormat.format(
"{0} {1} {2}", m_lefthandside, m_operator, m_righthandside );
interface of any binary expression type
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
Stream< IVariable<?> > variables()
returns a stream with all used variables
illegal argument exception
final IExpression leftHandSide()
returns the left-hand expression side
static< T > String languagestring(final T p_source, final String p_label, final Object... p_parameter)
returns the language depend string on any object
static final long serialVersionUID
serial id
IBaseBinary( @Nonnull final EOperator p_operator, @Nonnull final IExpression p_lefthandside, @Nonnull final IExpression p_righthandside)
ctor
execution context with local data
final IExpression rightHandSide()
returns the right-hand expression side
final EOperator m_operator
expression operator
final IExpression m_righthandside
right-hand-side argument
final EOperator operator()
return expression operator
final boolean equals(final Object p_object)
final Stream< IVariable<?> > variables()
returns a stream with all used variables
final IExpression m_lefthandside
left-hand-side argument
class for any helper calls
final boolean executearguments(final boolean p_parallel, @Nonnull final IContext p_context, @Nonnull final List< ITerm > p_argument)
execute expression arguments