Package jason.stdlib
Class printf
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.println
jason.stdlib.printf
- All Implemented Interfaces:
InternalAction
,Serializable
@Manual(literal=".printf(format,arg0[,arg1,...])",
hint="used for printing messages to the console inspired by Java printf/format",
argsHint={"the format of the output (not use \"%d\", Jason numbers are Java Double)","the terms to be printed out","the term to be concatenated with prior one and printed out [optional]"},
argsType={"string","term","term"},
examples={".printf(\"Value %08.0f%n\",N): prints Value 00461012, when N is 461012",".printf(\"Value \"%10.3f\"\",N): prints Value 3.142, when N is 3.14159"},
seeAlso={"jason.stdlib.print","jason.stdlib.println"})
public class printf
extends println
Internal action: .printf(format, args...)
.
Description: used for printing messages to the console inspired by Java printf/format. NB.: do not use "%d" since all numbers used by this internal action are translated from Jason to a Java double.
Examples:
-
.printf("Value %08.0f%n",N)
: printsValue 00461012
, when N is 461012. -
.printf("Value %10.3f",N)
: printsValue 3.142
, when N is 3.14159.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkArguments
(Term[] args) static InternalAction
create()
execute
(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.Methods inherited from class jason.stdlib.println
argsToString, getNewLine
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, destroy, getMaxArgs, getMinArgs, prepareArguments, suspendIntention
-
Constructor Details
-
printf
public printf()
-
-
Method Details
-
create
-
checkArguments
- Overrides:
checkArguments
in classDefaultInternalAction
- Throws:
JasonException
-
execute
Description copied from interface:InternalAction
Executes the internal action. It should return a Boolean or an Iterator. A true boolean return means that the IA was successfully executed. An Iterator result means that there is more than one answer for this IA (e.g. see member internal action). - Specified by:
execute
in interfaceInternalAction
- Overrides:
execute
in classprintln
- Throws:
Exception
-