Package org.projog.core.predicate.udp
Interface UserDefinedPredicateFactory
-
- All Superinterfaces:
PredicateFactory
- All Known Implementing Classes:
DynamicUserDefinedPredicateFactory,StaticUserDefinedPredicateFactory
public interface UserDefinedPredicateFactory extends PredicateFactory
Maintains a record of the clauses that define a user defined predicate.A user defined predicate is a predicate that is constructed from Prolog syntax consulted at runtime.

-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddFirst(ClauseModel clauseModel)Adds a clause to the beginning of the predicate's list of clauses.voidaddLast(ClauseModel clauseModel)Adds a clause to the end of the predicate's list of clauses.ClauseModelgetClauseModel(int index)Returns the clause at the specified position in this predicate's list of clauses.java.util.Iterator<ClauseModel>getImplications()Returns an iterator over the clauses in the predicate in proper sequence.PredicateKeygetPredicateKey()Returns the key for the predicate this object representsbooleanisDynamic()Returnstrueis this predicate is dynamic.-
Methods inherited from interface org.projog.core.predicate.PredicateFactory
getPredicate, isAlwaysCutOnBacktrack, isRetryable
-
-
-
-
Method Detail
-
addFirst
void addFirst(ClauseModel clauseModel)
Adds a clause to the beginning of the predicate's list of clauses.- Parameters:
clauseModel- the clause to add to the beginning of the predicate
-
addLast
void addLast(ClauseModel clauseModel)
Adds a clause to the end of the predicate's list of clauses.- Parameters:
clauseModel- the clause to add to the end of the predicate
-
getPredicateKey
PredicateKey getPredicateKey()
Returns the key for the predicate this object represents- Returns:
- the key for the predicate this object represents
-
getImplications
java.util.Iterator<ClauseModel> getImplications()
Returns an iterator over the clauses in the predicate in proper sequence.- Returns:
- an iterator over the clauses in the predicate in proper sequence.
-
isDynamic
boolean isDynamic()
Returnstrueis this predicate is dynamic.A "dynamic" predicate is a user defined predicate that can have clauses added or removed after is first defined.
- Returns:
trueis this predicate is dynamic
-
getClauseModel
ClauseModel getClauseModel(int index)
Returns the clause at the specified position in this predicate's list of clauses.- Parameters:
index- index of the clause to return- Returns:
- the clause at the specified position in this predicate's list of clauses or
nullif out of bounds
-
-