Interface CompoundTerm

All Known Implementing Classes:
AbstractCompoundTerm, Atom, CompoundTermImpl

public interface CompoundTerm
Interface to describe an ECLiPSe compound term. An object that implements it must be able to supply a functor, an arity, and arguments. The arguments may be of any Java class which represents an ECLiPSe data. Compound terms converted from EXDR format using EXDRInputStream implement this interface.

A compound term like p(q(2),a,"b") has functor "p" and arity 3, arg(1) is the term q(2) arg(2) is the term 'a' and arg(3) is the Java String "b".

  • Method Summary

    Modifier and Type
    Method
    Description
    arg(int i)
    Return the argument at position i.
    int
    Return the number of arguments.
    Return the functor of the compound term.
  • Method Details

    • functor

      String functor()
      Return the functor of the compound term.
    • arity

      int arity()
      Return the number of arguments.
    • arg

      Object arg(int i)
      Return the argument at position i. The returned object will instantiate the Java class/interface representing the corresponding ECLiPSe data type.
      Parameters:
      i - may vary between 1 and arity()