Class Nth
- java.lang.Object
-
- org.projog.core.predicate.AbstractPredicateFactory
-
- org.projog.core.predicate.builtin.list.Nth
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,PredicateFactory
public final class Nth extends AbstractPredicateFactory
nth0(X,Y,Z)/nth1(X,Y,Z)- examines an element of a list.Indexing starts at 0 when using
nth0. Indexing starts at 1 when usingnth1.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classNth.Retryable
-
Field Summary
Fields Modifier and Type Field Description private intstartingIdx
-
Constructor Summary
Constructors Modifier Constructor Description privateNth(int startingIdx)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanevaluate(int index, Term list, Term element)protected PredicategetPredicate(Term index, Term list, Term element)static Nthnth0()static Nthnth1()-
Methods inherited from class org.projog.core.predicate.AbstractPredicateFactory
getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicate, getPredicate, getPredicate, getPredicate, getPredicates, getProjogListeners, getSpyPoints, getTermFormatter, init, 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
-
-
-
-
Method Detail
-
nth0
public static Nth nth0()
-
nth1
public static Nth nth1()
-
getPredicate
protected Predicate getPredicate(Term index, Term list, Term element)
- Overrides:
getPredicatein classAbstractPredicateFactory
-
-