|
GNU Prolog for Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.prolog.database.Module
public class Module
Module in database
Field Summary | |
---|---|
protected List<Pair<PrologTextLoaderError,Term>> |
initialization
initialization |
protected List<PredicateListener> |
predicateListeners
|
protected Map<CompoundTermTag,Predicate> |
tag2predicate
map from tag to predicates |
Constructor Summary | |
---|---|
Module()
|
Method Summary | |
---|---|
void |
addInitialization(PrologTextLoaderError prologTextLoaderError,
Term term)
add term to initialization list |
void |
addPredicateListener(PredicateListener listener)
|
void |
clearInitialization()
Intended to be run from Environment.runInitialization(Interpreter)
and from nowhere else. |
Predicate |
createDefinedPredicate(CompoundTermTag tag)
create new predicate defined in this module |
Predicate |
getDefinedPredicate(CompoundTermTag tag)
get predicate defined in this module |
List<Pair<PrologTextLoaderError,Term>> |
getInitialization()
get initaliztion |
Set<CompoundTermTag> |
getPredicateTags()
get predicate tags |
void |
predicateUpdated(CompoundTermTag tag)
|
void |
removeDefinedPredicate(CompoundTermTag tag)
|
void |
removePredicateListener(PredicateListener listener)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map<CompoundTermTag,Predicate> tag2predicate
protected List<Pair<PrologTextLoaderError,Term>> initialization
protected List<PredicateListener> predicateListeners
Constructor Detail |
---|
public Module()
Method Detail |
---|
public Predicate createDefinedPredicate(CompoundTermTag tag)
tag
- tag of this predicate
IllegalStateException
- when predicate already existspublic Predicate getDefinedPredicate(CompoundTermTag tag)
tag
- tag of this predicate
public void removeDefinedPredicate(CompoundTermTag tag)
public void addInitialization(PrologTextLoaderError prologTextLoaderError, Term term)
prologTextLoaderError
- the partial error to be used if this term throws an errorterm
- the goal to execute at initializationpublic List<Pair<PrologTextLoaderError,Term>> getInitialization()
PrologTextLoaderError
s to be used if they throw an error.public void clearInitialization()
Environment.runInitialization(Interpreter)
and from nowhere else.
Resets the initialization list to the empty list so that they can be
iterated through again later.
Should be called in a synchronized block which read out the initiaization
list using getInitialization()
public Set<CompoundTermTag> getPredicateTags()
Predicate
s.public void predicateUpdated(CompoundTermTag tag)
public void addPredicateListener(PredicateListener listener)
public void removePredicateListener(PredicateListener listener)
|
GNU Prolog for Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |