Class KeySort
- java.lang.Object
-
- org.projog.core.predicate.AbstractSingleResultPredicate
-
- org.projog.core.predicate.builtin.list.KeySort
-
- All Implemented Interfaces:
KnowledgeBaseConsumer,PredicateFactory
public final class KeySort extends AbstractSingleResultPredicate
keysort(X,Y)- sorts a list of key/value pairs.Sorts the list
X, containing key/value pairs, and attempts to unify the result withY. Key/value pairs are compound terms with a functor of-and two arguments. The first argument is the key and the second argument is the value. It is the key of the key/value pairs that is used to sort the elements contained inX. (Note: duplicates are not removed.)
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Comparator<Term>KEY_VALUE_PAIR_COMPARATOR
-
Constructor Summary
Constructors Constructor Description KeySort()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanassertKeyValuePairs(java.util.List<Term> elements)protected booleanevaluate(Term original, Term result)-
Methods inherited from class org.projog.core.predicate.AbstractSingleResultPredicate
evaluate, evaluate, evaluate, evaluate, evaluate, getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, 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
-
-
-
-
Field Detail
-
KEY_VALUE_PAIR_COMPARATOR
private static final java.util.Comparator<Term> KEY_VALUE_PAIR_COMPARATOR
-
-
Method Detail
-
evaluate
protected boolean evaluate(Term original, Term result)
- Overrides:
evaluatein classAbstractSingleResultPredicate
-
assertKeyValuePairs
private boolean assertKeyValuePairs(java.util.List<Term> elements)
-
-