Class Elem


public class Elem extends PrimitiveFunction
Checks if an element is in a list.
  • Constructor Details

    • Elem

      public Elem()
  • Method Details

    • name

      public Name name()
      Description copied from class: PrimitiveFunction
      The unique name of the primitive function.
      Specified by:
      name in class PrimitiveFunction
      Returns:
      the name of this primitive function
    • type

      public TypeScheme type()
      Description copied from class: PrimitiveFunction
      The datatype of the primitive function.
      Specified by:
      type in class PrimitiveFunction
      Returns:
      the type scheme of this primitive function
    • implementation

      protected Function<List<Term>,Flow<Graph,Term>> implementation()
      Description copied from class: PrimitiveFunction
      A dynamic/interpreted implementation of the function.
      Specified by:
      implementation in class PrimitiveFunction
      Returns:
      the function implementation
    • apply

      public static <X> Function<List<X>,Boolean> apply(X elem)
      Checks if the element is present.
      Type Parameters:
      X - the element type
      Parameters:
      elem - the element to search for
      Returns:
      a function that checks if the element is present in a list
    • apply

      public static <X> Boolean apply(X elem, List<X> lst)
      Checks if the element is present.
      Type Parameters:
      X - the element type
      Parameters:
      elem - the element to search for
      lst - the list to search in
      Returns:
      true if present, false otherwise