| 
 | GNU Prolog for Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgnu.prolog.database.Predicate
public class Predicate
Predicate in database
| Nested Class Summary | |
|---|---|
| static class | Predicate.TYPEThe possible types of Predicate | 
| Field Summary | |
|---|---|
| protected  List<Term> | clauseslist of clauses for this predicate | 
| protected  boolean | dynamicFlagdynamic property of predicate | 
| protected  Set<String> | filesset files where this predicate is defined | 
| protected  String | javaClassNameclass name for external predicate | 
| protected  Module | modulecurrent module | 
| protected  boolean | propertiesLockedflag which indicate that clauses was added for this predicate | 
| protected  CompoundTermTag | taga tag of predicate head | 
| protected  Predicate.TYPE | typetype of predicate. | 
| Constructor Summary | |
|---|---|
| Predicate(Module module,
          CompoundTermTag tag)constructor of predicate | |
| Method Summary | |
|---|---|
|  void | addClauseFirst(Term clause)Add clause for predicate at the beginning. | 
|  void | addClauseLast(Term clause)Add clause for predicate at the end. | 
|  boolean | arePropertiesLocked()Check if properties of predicate could be changed at this moment | 
|  int | getArity()get arity of predicate | 
|  List<Term> | getClauses()get clauses of predicate You must synchronize on this class when iterating through this list as although it is a synchronized list you are getting a unmodifiable view of that list. | 
|  AtomTerm | getFunctor()get functor of predicate | 
|  String | getJavaClassName()Get name of Java class that defines this predicate. | 
|  CompoundTermTag | getTag()get tag of predicate | 
|  Predicate.TYPE | getType()get type of predicate | 
|  boolean | isDynamic()Check if predicate is dynamic. | 
| static Term | prepareBody(Term body) | 
| static Term | prepareClause(Term clause) | 
| static Term | prepareHead(Term head) | 
|  void | removeClause(Term clause)Remove clause for predicate. | 
|  void | setDynamic()set "dynamic" property of predicate to true. | 
|  void | setJavaClassName(String javaClassName)set java class name of the predicate. | 
|  void | setType(Predicate.TYPE type)set type of predicate | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected Predicate.TYPE type
protected CompoundTermTag tag
protected List<Term> clauses
protected boolean propertiesLocked
protected boolean dynamicFlag
protected String javaClassName
protected Set<String> files
protected Module module
| Constructor Detail | 
|---|
public Predicate(Module module,
                 CompoundTermTag tag)
module - tag - | Method Detail | 
|---|
public List<Term> getClauses()
Predicatepublic Predicate.TYPE getType()
public void setType(Predicate.TYPE type)
type - type of predicate
IllegalStateException - if predicate type is already setpublic String getJavaClassName()
public void setJavaClassName(String javaClassName)
javaClassName - the class name to setpublic AtomTerm getFunctor()
public int getArity()
Predicatepublic CompoundTermTag getTag()
public void addClauseLast(Term clause)
clause - a clause to addpublic void addClauseFirst(Term clause)
clause - a clause to addpublic void removeClause(Term clause)
clause - a clause to removepublic boolean arePropertiesLocked()
public boolean isDynamic()
public void setDynamic()
IllegalStateException - if there were clauses added to predicate and dynamic flag was not
           set before. See 7.4.2.1 clause of ISO Prolog.public static Term prepareClause(Term clause)
public static Term prepareHead(Term head)
public static Term prepareBody(Term body)
| 
 | GNU Prolog for Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||