Package jason.stdlib
Class namespace
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.namespace
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
@Manual(literal=".namespace(argument)", hint="checks whether the argument is a namespace", argsHint="the term to be checked", argsType="term", examples={".namespace(family), assuming the BB is {a(10),family::brother(bob),b(f,1)}: true",".namespace(any_other), assuming the BB is {a(10),family::brother(bob),b(f,1)}: false"}, seeAlso={"jason.stdlib.findall","jason.stdlib.setof","jason.stdlib.count"}) public class namespace extends DefaultInternalAction
Internal action: .namespace
.
Description: checks whether the argument is a namespace.
Parameter:
- + arg[0] (any term): the term to be checked.
Examples assuming the BB is currently {a(10),family::brother(bob),b(f,1)}:
-
.namespace(family)
: true. -
.namespace(any_other)
: false.
- See Also:
findall
,setof
,count
, Serialized Form
-
Constructor Summary
Constructors Constructor Description namespace()
-
Method Summary
Modifier and Type Method Description protected void
checkArguments(Term[] args)
java.lang.Object
execute(TransitionSystem ts, Unifier un, Term[] args)
Executes the internal action.int
getMaxArgs()
int
getMinArgs()
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, destroy, prepareArguments, suspendIntention
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
namespace
public namespace()
-
-
Method Details
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classDefaultInternalAction
-
checkArguments
- Overrides:
checkArguments
in classDefaultInternalAction
- Throws:
JasonException
-
execute
public java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.ExceptionDescription 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 classDefaultInternalAction
- Throws:
java.lang.Exception
-