Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jason.functions
Class Length

    java.lang.Object
      jason.asSemantics.DefaultArithFunction
          jason.functions.Length

All Implemented Interfaces:
  ArithFunction, java.io.Serializable

    public class Length

extends DefaultArithFunction

Function: `.length(L)`: returns the size of either the list or string L.

Examples:

- `.length("aa")`: returns 2.
- `.length([a,b,c])`: returns 3.

See Also:
  `internal action version`, Serialized Form

Constructor Summary
`Length()`

Method Summary
`boolean` | `allowUngroundTerms()` returns true if the arguments of the function can be unground (as in .count)
`boolean` | `checkArity(int a)` returns true if a is a good number of arguments for the function
`double` | `evaluate(TransitionSystem ts, Term[] args)` evaluates/computes the function based on the args
`java.lang.String` | `getName()` returns the name of the function

Methods inherited from class jason.asSemantics.DefaultArithFunction
`toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Length

    public Length()

Method Detail

### getName

    public java.lang.String getName()

  Description copied from interface: `ArithFunction`
  returns the name of the function

  Specified by:
    `getName` in interface `ArithFunction`
  Overrides:
    `getName` in class `DefaultArithFunction`

### evaluate

    public double evaluate(TransitionSystem ts,
                           Term[] args)
                    throws JasonException

  Description copied from interface: `ArithFunction`
  evaluates/computes the function based on the args

  Specified by:
    `evaluate` in interface `ArithFunction`
  Overrides:
    `evaluate` in class `DefaultArithFunction`
  Throws:
    `JasonException`

### checkArity

    public boolean checkArity(int a)

  Description copied from interface: `ArithFunction`
  returns true if a is a good number of arguments for the function

  Specified by:
    `checkArity` in interface `ArithFunction`
  Overrides:
    `checkArity` in class `DefaultArithFunction`

### allowUngroundTerms

    public boolean allowUngroundTerms()

  Description copied from interface: `ArithFunction`
  returns true if the arguments of the function can be unground (as in .count)

  Specified by:
    `allowUngroundTerms` in interface `ArithFunction`
  Overrides:
    `allowUngroundTerms` in class `DefaultArithFunction`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD