Esempio n. 1
0
 def compute(self, compute_func):
     compute_wrapper = function_wrapper(compute_func)
     # if function has two arguments, user is expecting the collector version of compute
     if len(signature(compute_func).parameters) is 3:
         compute_collector_func_java_ref = self.__env.functions \
             .compute_with_collector.build(compute_wrapper)
         return ts.TSet(
             self.__java_ref.compute(compute_collector_func_java_ref),
             self.__env)
     else:
         compute_func_java_ref = self.__env.functions.compute.build(
             compute_wrapper)
         return ts.TSet(self.__java_ref.compute(compute_func_java_ref),
                        self.__env)
Esempio n. 2
0
 def flat_map(self, lam):
     flat_map_wrapper = function_wrapper(lam)
     flat_map_func_java_ref = self.__env.functions.flat_map.build(
         flat_map_wrapper)
     flat_map_t_set_java_ref = self.__java_ref.flatmap(
         flat_map_func_java_ref)
     return ts.TSet(flat_map_t_set_java_ref, self.__env)
Esempio n. 3
0
 def for_each(self, foreach_func):
     foreach_wrapper = function_wrapper(foreach_func)
     foreach_func_java_ref = self.__env.functions.apply.build(
         foreach_wrapper)
     return ts.TSet(self.__java_ref.forEach(foreach_func_java_ref),
                    self.__env)
Esempio n. 4
0
 def map(self, lam):
     map_wrapper = function_wrapper(lam)
     map_func_java_ref = self.__env.functions.map.build(map_wrapper)
     map_t_set_java_ref = self.__java_ref.map(map_func_java_ref)
     return ts.TSet(map_t_set_java_ref, self.__env)
Esempio n. 5
0
 def compute(self, compute_func):
     compute_wrapper = function_wrapper(compute_func)
     compute_func_java_ref = self.__env.functions.compute.build(
         compute_wrapper)
     return ts.TSet(self.__java_ref.compute(compute_func_java_ref),
                    self.__env)