Class KeySort
java.lang.Object
org.projog.core.predicate.AbstractSingleResultPredicate
org.projog.core.predicate.builtin.list.KeySort
- All Implemented Interfaces:
KnowledgeBaseConsumer, PredicateFactory
keysort(X,Y) - sorts a list of key/value pairs.
Sorts the list X, containing key/value pairs, and attempts to unify the result with
Y. 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 in X. (Note: duplicates are not removed.)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractSingleResultPredicate
evaluate, evaluate, evaluate, evaluate, evaluate, getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicates, getProjogListeners, getSpyPoints, getTermFormatter, init, isRetryable, setKnowledgeBaseMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PredicateFactory
isAlwaysCutOnBacktrack
-
Field Details
-
KEY_VALUE_PAIR_COMPARATOR
-
-
Constructor Details
-
KeySort
public KeySort()
-
-
Method Details
-
evaluate
- Overrides:
evaluatein classAbstractSingleResultPredicate
-
assertKeyValuePairs
-