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 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 Details

    • KEY_VALUE_PAIR_COMPARATOR

      private static final Comparator<Term> KEY_VALUE_PAIR_COMPARATOR
  • Constructor Details

    • KeySort

      public KeySort()
  • Method Details