24 package org.lightjason.agentspeak.action.builtin.collection.list;
34 import javax.annotation.Nonnegative;
35 import javax.annotation.Nonnull;
36 import java.util.HashSet;
37 import java.util.List;
39 import java.util.stream.Collectors;
40 import java.util.stream.IntStream;
77 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return )
79 final List<Object> l_list = p_argument.get( 0 ).<List<Object>>raw();
80 final Set<Integer> l_removed =
new HashSet<>();
83 .map(
ITerm::<Number>raw )
84 .map( Number::intValue )
88 return l_list.get( i );
91 .forEach( p_return::add );
93 final List<Object> l_result = IntStream.range( 0, l_list.size() )
96 .filter( i -> !l_removed.contains( i ) )
98 .collect( Collectors.toList() );
101 l_list.addAll( l_result );
base class of build-in actions for setting name by package/classname (without prefix character) ...
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
common structure for execution definition
static final long serialVersionUID
serial id
execution context with local data
static Stream< ITerm > flatten( @Nonnull final Collection<? extends ITerm > p_terms)
flat term-in-term collection into a straight term list
result for an immutable fuzzy value
static< N > CRawTerm< N > from(final N p_value)
factory for a raw term
removes an element of the list by the index.
final int minimalArgumentNumber()
minimum number of arguments
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
term structure for simple datatypes