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
 java.lang.Object arg(int i)
          Return the argument at position i.
 int arity()
          Return the number of arguments.
 java.lang.String functor()
          Return the functor of the compound term.

Method Detail


public java.lang.String functor()
Return the functor of the compound term.


public int arity()
Return the number of arguments.


public java.lang.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.

i - may vary between 1 and arity()