alice.tuprolog
Class PrimitiveInfo

java.lang.Object
  extended byalice.tuprolog.PrimitiveInfo

public class PrimitiveInfo
extends java.lang.Object

Primitive class referring to a builtin predicate or functor

See Also:
Struct

Field Summary
static int DIRECTIVE
           
static int FUNCTOR
           
static int PREDICATE
           
 
Constructor Summary
PrimitiveInfo(int type, java.lang.String key, Library lib, java.lang.reflect.Method m, int arity)
           
 
Method Summary
 void evalAsDirective(Struct g)
          evaluates the primitive as a directive
 Term evalAsFunctor(Struct g)
          evaluates the primitive as a functor
 boolean evalAsPredicate(Struct g)
          evaluates the primitive as a predicate
 java.lang.String getKey()
           
 IPrimitives getSource()
           
 int getType()
           
 java.lang.String invalidate()
          Method to invalidate primitives.
 boolean isDirective()
           
 boolean isFunctor()
           
 boolean isPredicate()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIRECTIVE

public static final int DIRECTIVE
See Also:
Constant Field Values

PREDICATE

public static final int PREDICATE
See Also:
Constant Field Values

FUNCTOR

public static final int FUNCTOR
See Also:
Constant Field Values
Constructor Detail

PrimitiveInfo

public PrimitiveInfo(int type,
                     java.lang.String key,
                     Library lib,
                     java.lang.reflect.Method m,
                     int arity)
              throws java.lang.NoSuchMethodException
Method Detail

invalidate

public java.lang.String invalidate()
Method to invalidate primitives. It's called just mother library removed


getKey

public java.lang.String getKey()

isDirective

public boolean isDirective()

isFunctor

public boolean isFunctor()

isPredicate

public boolean isPredicate()

getType

public int getType()

getSource

public IPrimitives getSource()

evalAsDirective

public void evalAsDirective(Struct g)
                     throws java.lang.IllegalAccessException,
                            java.lang.reflect.InvocationTargetException
evaluates the primitive as a directive

Throws:
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.Exception - if invocation directive failure

evalAsPredicate

public boolean evalAsPredicate(Struct g)
                        throws java.lang.Throwable
evaluates the primitive as a predicate

Throws:
java.lang.Exception - if invocation primitive failure
java.lang.Throwable

evalAsFunctor

public Term evalAsFunctor(Struct g)
evaluates the primitive as a functor


toString

public java.lang.String toString()