Package hydra.overlay.java.lib.sets
Class Unions
- java.lang.Object
-
- hydra.overlay.java.tools.PrimitiveFunction
-
- hydra.overlay.java.lib.sets.Unions
-
public class Unions extends PrimitiveFunction
Computes the union of multiple sets.
-
-
Constructor Summary
Constructors Constructor Description Unions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <X> java.util.Set<X>apply(java.util.List<java.util.Set<X>> sets)Computes the union of multiple sets.protected java.util.function.Function<java.util.List<Term>,java.util.function.Function<Graph,Either<Error_,Term>>>implementation()Provides the implementation of this primitive function.Namename()Returns the name of this primitive function.TypeSchemetype()Returns the type scheme of this function.-
Methods inherited from class hydra.overlay.java.tools.PrimitiveFunction
isPure, lazyParams, term, toNative
-
-
-
-
Method Detail
-
name
public Name name()
Returns the name of this primitive function.- Specified by:
namein classPrimitiveFunction- Returns:
- the name "hydra.lib.sets.unions"
-
type
public TypeScheme type()
Returns the type scheme of this function.- Specified by:
typein classPrimitiveFunction- Returns:
- the type scheme for a function that computes the union of multiple sets
-
implementation
protected java.util.function.Function<java.util.List<Term>,java.util.function.Function<Graph,Either<Error_,Term>>> implementation()
Provides the implementation of this primitive function.- Specified by:
implementationin classPrimitiveFunction- Returns:
- a function that transforms terms to a flow of graph and term
-
apply
public static <X> java.util.Set<X> apply(java.util.List<java.util.Set<X>> sets)
Computes the union of multiple sets.- Type Parameters:
X- the type of elements in the sets- Parameters:
sets- the list of sets to combine- Returns:
- a new set containing all elements from all input sets
-
-