Class TermCompound

This represents a compound term. There are two functor and argument based constructor. The constructor without the interpreter parameter assumes that the arguments belong to the same display. The constructor with the interpreter parameter can deal with arguments that belong to different displays.

The later constructors will fall back to the former constructors if the arguments belong never-theless to the same display. Otherwise a new fresh display is created and the arguments are bound to this display. For automatic reference counting also there reference count of any of argument display that was fresh, will be decremented.

The functor and arity can be retrieved by the methods getFunctor() and getArity(). An individual argument can be retrieved by the method getArg(). The later method will automatically do a dereferencing.  The method variants getFunctorWrapped() and getArgWrapped() return wrapped results.

package jekpro.tools.term;

public final class TermCompound extends AbstractTerm {
public TermCompound(String sym, Object... args);
public TermCompound(TermAtomic sym, Object... args);
public TermCompound(Interpreter inter, String sym, Object... args);
public TermCompound(Interpreter inter, TermAtomic sym, Object... args);

public int hashCode();
public boolean equals(Object o);

    public String getFunctor();
public TermAtomic getFunctorWrapped();
    public int getArity();
    public Object getArg(int k);
public AbstractTerm getArgWrapped(int k);
}

Comments