24 package org.lightjason.agentspeak.action.builtin.datetime;
35 import javax.annotation.Nonnegative;
36 import javax.annotation.Nonnull;
37 import java.time.ZonedDateTime;
38 import java.util.List;
39 import java.util.Locale;
40 import java.util.stream.Collectors;
41 import java.util.stream.Stream;
71 @Nonnull
final List<ITerm> p_argument, @Nonnull
final List<ITerm> p_return )
73 final List<ITerm> l_arguments =
CCommon.
flatten( p_argument ).collect( Collectors.toList() );
75 switch ( l_arguments.get( 0 ).<String>raw().trim().toLowerCase( Locale.ROOT ) )
82 .map(
ITerm::<ZonedDateTime>raw ),
83 l_arguments.get( 1 ).<Number>raw().longValue()
86 .forEach( p_return::add );
95 .map(
ITerm::<ZonedDateTime>raw ),
96 l_arguments.get( 1 ).<Number>raw().longValue()
99 .forEach( p_return::add );
118 protected abstract Stream<?>
applyminus( @Nonnull
final Stream<ZonedDateTime> p_datetime,
final long p_value );
128 protected abstract Stream<?>
applyplus( @Nonnull
final Stream<ZonedDateTime> p_datetime,
final long p_value );
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
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
abstract class to calculate plus / minus on date-time objects
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
abstract Stream<?> applyplus( @Nonnull final Stream< ZonedDateTime > p_datetime, final long p_value)
apply function for minus operator
static final long serialVersionUID
serial id
result for an immutable fuzzy value
static< N > CRawTerm< N > from(final N p_value)
factory for a raw term
final int minimalArgumentNumber()
minimum number of arguments
abstract Stream<?> applyminus( @Nonnull final Stream< ZonedDateTime > p_datetime, final long p_value)
apply function for plus operator
term structure for simple datatypes