Class FilterWithKey


  • public class FilterWithKey
    extends PrimitiveFunction
    Filters map entries by key and value.
    • Constructor Summary

      Constructors 
      Constructor Description
      FilterWithKey()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <K,​V>
      java.util.function.Function<PersistentMap<K,​V>,​PersistentMap<K,​V>>
      apply​(java.util.function.Function<K,​java.util.function.Function<V,​java.lang.Boolean>> pred)
      Filters entries based on a curried key-value predicate (used by generated code).
      static <K,​V>
      PersistentMap<K,​V>
      apply​(java.util.function.Function<K,​java.util.function.Function<V,​java.lang.Boolean>> pred, PersistentMap<K,​V> mp)
      Filters entries based on a curried key-value predicate (used by generated code).
      protected java.util.function.Function<java.util.List<Term>,​java.util.function.Function<Context,​java.util.function.Function<Graph,​Either<InContext<Error_>,​Term>>>> implementation()
      Get the implementation of this primitive function.
      Name name()
      Get the name of this primitive function.
      TypeScheme type()
      Get the type scheme of this primitive function.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FilterWithKey

        public FilterWithKey()
    • Method Detail

      • name

        public Name name()
        Get the name of this primitive function.
        Specified by:
        name in class PrimitiveFunction
        Returns:
        the name
      • apply

        public static <K,​V> java.util.function.Function<PersistentMap<K,​V>,​PersistentMap<K,​V>> apply​(java.util.function.Function<K,​java.util.function.Function<V,​java.lang.Boolean>> pred)
        Filters entries based on a curried key-value predicate (used by generated code).
        Type Parameters:
        K - the key type
        V - the value type
        Parameters:
        pred - the curried predicate: key -> value -> Boolean
        Returns:
        a function that takes a map and returns the filtered map
      • apply

        public static <K,​V> PersistentMap<K,​V> apply​(java.util.function.Function<K,​java.util.function.Function<V,​java.lang.Boolean>> pred,
                                                                 PersistentMap<K,​V> mp)
        Filters entries based on a curried key-value predicate (used by generated code).
        Type Parameters:
        K - the key type
        V - the value type
        Parameters:
        pred - the curried predicate: key -> value -> Boolean
        mp - the map to filter
        Returns:
        the filtered map