Example #1
0
 /**
  * Answers a bound static function. The static function is looked up from the passed in clz and
  * then is bound to that clz. If the optional args are passed in, they are treated as curry args.
  */
 public <R> JFunction<Class<?>, R> bind(
     Class<?> clz, Class<R> returnType, String funcName, Object... args) {
   JFunction<Class<?>, R> f = ref(clz, returnType, funcName);
   return FuncX.bind(clz, f, args);
 }
Example #2
0
 /**
  * The returned function closure (currying function) will combine the passed-in arguments with
  * arguments at the time of function invocation.
  */
 public <T, E> JFunction<T, E> curry(JFunction<T, E> func, Object... args) {
   return FuncX.curry(func, args);
 }
Example #3
0
 /**
  * The returned function closure (currying function) will combine the passed-in arguments with
  * arguments at the time of function invocation.
  */
 public <T> INativeJsFuncProxy<T> curry(INativeJsFuncProxy<T> func, Object... args) {
   return FuncX.curry(func, args);
 }
Example #4
0
 /**
  * If openCtx is false, the returned function will ensure that the func in closure will always be
  * bound to ctx. If openCtx is true, the returned function will ensure that the func in closure
  * will be bound to ctx if the calling function is bound to global context, otherwise, func will
  * be rebound to new context associated with calling function.
  */
 public <T> INativeJsFuncProxy<T> hitch(T ctx, INativeJsFuncProxy<T> func, boolean openCtx) {
   return FuncX.hitch(ctx, func, openCtx);
 }
Example #5
0
 /** The returned function will ensure that the func in enclosure will always be bound to ctx. */
 public <T> INativeJsFuncProxy<T> hitch(T ctx, INativeJsFuncProxy<T> func) {
   return FuncX.hitch(ctx, func);
 }
Example #6
0
 /**
  * If openCtx is false, the returned function will ensure that the func in closure will always be
  * bound to ctx. If openCtx is true, the returned function will ensure that the func in closure
  * will be bound to ctx if the calling function is bound to global context, otherwise, func will
  * be rebound to new context associated with calling function.
  */
 public <T, E> JFunction<T, E> hitch(T ctx, JFunction<T, E> func, boolean openCtx) {
   return FuncX.hitch(ctx, func, openCtx);
 }
Example #7
0
 /** The returned function will ensure that the func in enclosure will always be bound to ctx. */
 public <T, E> JFunction<T, E> hitch(T ctx, JFunction<T, E> func) {
   return FuncX.hitch(ctx, func);
 }
Example #8
0
 /**
  * Answers a bound instance function. The instance function is looked up from the passed in
  * thisObj and then is bound to that thisObj. If the optional args are passed in, they are treated
  * as curry args.
  */
 public <T, R> JFunction<T, R> bind(
     T thisObj, Class<R> returnType, String funcName, Object... args) {
   JFunction<T, R> f = ref(thisObj, returnType, funcName);
   return FuncX.bind(thisObj, f, args);
 }