Class InsertRecord
- java.lang.Object
-
- org.projog.core.predicate.AbstractSingleResultPredicate
-
- org.projog.core.predicate.builtin.db.InsertRecord
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,PredicateFactory
public final class InsertRecord extends AbstractSingleResultPredicate
recorda(X,Y,Z)/recordz(X,Y,Z)- associates a term with a key.recorda(X,Y,Z)associatesYwithX. The unique reference for this association will be unified withZ.Yis added to the start of the list of terms already associated withX.recordz(X,Y,Z)associatesYwithX. The unique reference for this association will be unified withZ.Yis added to the end of the list of terms already associated withX.
-
-
Field Summary
Fields Modifier and Type Field Description private RecordedDatabasedatabaseprivate booleaninsertLast
-
Constructor Summary
Constructors Modifier Constructor Description privateInsertRecord(boolean insertLast)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanevaluate(Term key, Term value)protected booleanevaluate(Term key, Term value, Term reference)voidinit()This method is called byAbstractSingleResultPredicate.setKnowledgeBase(KnowledgeBase).static InsertRecordrecordA()static InsertRecordrecordZ()-
Methods inherited from class org.projog.core.predicate.AbstractSingleResultPredicate
evaluate, evaluate, evaluate, evaluate, getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicates, getProjogListeners, getSpyPoints, getTermFormatter, isRetryable, setKnowledgeBase
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.projog.core.predicate.PredicateFactory
isAlwaysCutOnBacktrack
-
-
-
-
Field Detail
-
insertLast
private final boolean insertLast
-
database
private RecordedDatabase database
-
-
Method Detail
-
recordA
public static InsertRecord recordA()
-
recordZ
public static InsertRecord recordZ()
-
init
public void init()
Description copied from class:AbstractSingleResultPredicateThis method is called byAbstractSingleResultPredicate.setKnowledgeBase(KnowledgeBase).Can be overridden by subclasses to perform initialisation before any calls to
AbstractSingleResultPredicate.evaluate(Term...)are made. AsAbstractSingleResultPredicate.setKnowledgeBase(KnowledgeBase)will have already been called before this method is invoked, overridden versions will be able to access theKnowledgeBaseusingAbstractSingleResultPredicate.getKnowledgeBase().- Overrides:
initin classAbstractSingleResultPredicate
-
evaluate
protected boolean evaluate(Term key, Term value)
- Overrides:
evaluatein classAbstractSingleResultPredicate
-
evaluate
protected boolean evaluate(Term key, Term value, Term reference)
- Overrides:
evaluatein classAbstractSingleResultPredicate
-
-