public final class Last extends AbstractPredicateFactory
last(X,Y)
- finds the last element of a list.Constructor and Description |
---|
Last() |
Modifier and Type | Method and Description |
---|---|
protected Predicate |
getPredicate(Term list,
Term termToUnifyLastElementWith) |
boolean |
isRetryable()
Should instances of this implementation be re-evaluated when backtracking?
|
getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicate, getPredicate, getPredicate, getPredicate, getPredicates, getProjogListeners, getSpyPoints, getTermFormatter, init, setKnowledgeBase
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isAlwaysCutOnBacktrack
protected Predicate getPredicate(Term list, Term termToUnifyLastElementWith)
getPredicate
in class AbstractPredicateFactory
public boolean isRetryable()
PredicateFactory
Some goals (e.g. X is 1
) are only meant to be evaluated once (the statement is either true or false) while
others (e.g. repeat(3)
) are meant to be evaluated multiple times. For instances of Predicate
that
are designed to possibly have Predicate.evaluate()
called on them multiple times for the same individual
query this method should return true
. For instances of Predicate
that are designed to only be
evaluated once per individual query this method should return false
.
isRetryable
in interface PredicateFactory
isRetryable
in class AbstractPredicateFactory
true
if an attempt should be made to re-evaluate instances of implementing classes when
backtracking, false
otherwiseCopyright © 2024. All rights reserved.