Package jason.stdlib
Class length
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.length
- All Implemented Interfaces:
 InternalAction,Serializable
@Manual(literal=".length(argument,length)",
        hint="gets the length of strings or lists",
        argsHint={"the term whose length is to be determined","the resulting length"},
        argsType={"string or list","number"},
        examples={".length(\"abc\",X): X unifies with 3",".length([a,b],X): X unifies with 2",".length(\"a\",2): false"},
        seeAlso={"jason.stdlib.concat","jason.stdlib.delete","jason.stdlib.member","jason.stdlib.sort","jason.stdlib.nth","jason.stdlib.max","jason.stdlib.min","jason.stdlib.reverse","jason.stdlib.difference","jason.stdlib.intersection","jason.stdlib.union"})
public class length
extends DefaultInternalAction
Internal action: .length.
  
Description: gets the length of strings or lists.
Parameters:
- + argument (string or list): the term whose length is to be determined.
 - +/- length (number).
 
Examples:
-  
.length("abc",X):Xunifies with 3. -  
.length([a,b],X):Xunifies with 2. -  
.length("a",2): false. 
- See Also:
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic InternalActioncreate()execute(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.intintstatic NumberTermMethods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, checkArguments, destroy, prepareArguments, suspendIntention 
- 
Constructor Details
- 
length
public length() 
 - 
 - 
Method Details
- 
create
 - 
getMinArgs
public int getMinArgs()- Overrides:
 getMinArgsin classDefaultInternalAction
 - 
getMaxArgs
public int getMaxArgs()- Overrides:
 getMaxArgsin classDefaultInternalAction
 - 
execute
Description copied from interface:InternalActionExecutes 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:
 executein interfaceInternalAction- Overrides:
 executein classDefaultInternalAction- Throws:
 Exception
 - 
getSize
 
 -