Package hydra.lib.maps
Class Singleton
java.lang.Object
hydra.tools.PrimitiveFunction
hydra.lib.maps.Singleton
Creates a singleton list.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(K key) Creates a map with one element.static <K,V> Map<K, V> apply(K key, V value) Creates a map with one element.Get the implementation of this primitive function.name()Get the name of this primitive function.type()Get the type scheme of this primitive function.Methods inherited from class hydra.tools.PrimitiveFunction
term, toNative
-
Constructor Details
-
Singleton
public Singleton()
-
-
Method Details
-
name
Get the name of this primitive function.- Specified by:
namein classPrimitiveFunction- Returns:
- the name
-
type
Get the type scheme of this primitive function.- Specified by:
typein classPrimitiveFunction- Returns:
- the type scheme
-
implementation
Get the implementation of this primitive function.- Specified by:
implementationin classPrimitiveFunction- Returns:
- the implementation function
-
apply
Creates a map with one element.- Type Parameters:
K- the key typeV- the value type- Parameters:
key- the key- Returns:
- a function that takes a value and returns the singleton map
-
apply
Creates a map with one element.- Type Parameters:
K- the key typeV- the value type- Parameters:
key- the keyvalue- the value- Returns:
- the singleton map
-