Package hydra.lib.lists
Class Group
- java.lang.Object
-
- hydra.tools.PrimitiveFunction
-
- hydra.lib.lists.Group
-
public class Group extends PrimitiveFunction
Groups consecutive equal elements.
-
-
Constructor Summary
Constructors Constructor Description Group()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <X> java.util.List<java.util.List<X>>apply(java.util.List<X> lst)Groups consecutive equal elements.protected java.util.function.Function<java.util.List<Term>,java.util.function.Function<InferenceContext,java.util.function.Function<Graph,Either<Error_,Term>>>>implementation()A dynamic/interpreted implementation of the function.Namename()The unique name of the primitive function.TypeSchemetype()The datatype of the primitive function.-
Methods inherited from class hydra.tools.PrimitiveFunction
lazyParams, term, toNative
-
-
-
-
Method Detail
-
name
public Name name()
Description copied from class:PrimitiveFunctionThe unique name of the primitive function.- Specified by:
namein classPrimitiveFunction- Returns:
- the name of this primitive function
-
type
public TypeScheme type()
Description copied from class:PrimitiveFunctionThe datatype of the primitive function.- Specified by:
typein classPrimitiveFunction- Returns:
- the type scheme of this primitive function
-
implementation
protected java.util.function.Function<java.util.List<Term>,java.util.function.Function<InferenceContext,java.util.function.Function<Graph,Either<Error_,Term>>>> implementation()
Description copied from class:PrimitiveFunctionA dynamic/interpreted implementation of the function. Subclasses implement this with Either-based logic.- Specified by:
implementationin classPrimitiveFunction- Returns:
- the function implementation
-
apply
public static <X> java.util.List<java.util.List<X>> apply(java.util.List<X> lst)
Groups consecutive equal elements.- Type Parameters:
X- the element type- Parameters:
lst- the list to group- Returns:
- the list of groups of consecutive equal elements
-
-