Prolog Cafe v1.2

jp.ac.kobe_u.cs.prolog.lang
Class PredicateEncoder

java.lang.Object
  extended by jp.ac.kobe_u.cs.prolog.lang.PredicateEncoder

public class PredicateEncoder
extends java.lang.Object

The PredicateEncoder class contains static methods for encoding predicate names.
The predicate with hoge:f/n is encoded to hoge.PRED_f_n, where hoge is package name, f is predicate name, and n is arity.
When encoding a predicate name, we apply the following rules:

For example, a predicate with hoge:(=..)/2 is encoded to hoge.PRED_$003D$002E$002E_2.


Constructor Summary
PredicateEncoder()
           
 
Method Summary
static boolean defined(java.lang.String pkg, java.lang.String functor, int arity)
          Deprecated. As of Prolog Cafe 1.1, replaced by PrologClassLoader.definedPredicate(String,String,int);
static java.lang.String encode(java.lang.String pkg, java.lang.String functor, int arity)
          Returns a string representation of class for the predicate with the given arguments.
static java.lang.Class getClass(java.lang.String pkg, java.lang.String functor, int arity)
          Deprecated. As of Prolog Cafe 1.1, replaced by PrologClassLoader.loadPredicateClass(String,String,int,boolean);
static void main(java.lang.String[] argv)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PredicateEncoder

public PredicateEncoder()
Method Detail

encode

public static java.lang.String encode(java.lang.String pkg,
                                      java.lang.String functor,
                                      int arity)
Returns a string representation of class for the predicate with the given arguments.

Parameters:
pkg - package name
functor - predicate name
arity - predicate arity
Returns:
a string representation of class for the predicate that corresponds to pkg:functor/arity.

getClass

public static java.lang.Class getClass(java.lang.String pkg,
                                       java.lang.String functor,
                                       int arity)
Deprecated. As of Prolog Cafe 1.1, replaced by PrologClassLoader.loadPredicateClass(String,String,int,boolean);

Returns a java.lang.Class object associated with the predicate class with the given arguments.

Parameters:
pkg - package name
functor - predicate name
arity - predicate arity
Returns:
a java.lang.Class object associated with the predicate class that corresponds to pkg:functor/arity if exists, otherwise null.

defined

public static boolean defined(java.lang.String pkg,
                              java.lang.String functor,
                              int arity)
Deprecated. As of Prolog Cafe 1.1, replaced by PrologClassLoader.definedPredicate(String,String,int);

Check whether the predicate class for the given arguments is defined.

Parameters:
pkg - package name
functor - predicate name
arity - predicate arity
Returns:
true if the predicate pkg:functor/arity is defined, otherwise false.

main

public static void main(java.lang.String[] argv)

Prolog Cafe v1.2

Copyright (C) 1997-2008 M.BANBARA and N.TAMURA