Ejemplo n.º 1
0
 /**
  * Gets the best {@link NullaryHybridCF} implementation for the given types and arguments,
  * populating its inputs.
  *
  * @param ops The {@link OpEnvironment} to search for a matching op.
  * @param opType The {@link Class} of the operation. If multiple {@link NullaryHybridCF}s share
  *     this type (e.g., the type is an interface which multiple {@link NullaryHybridCF}s
  *     implement), then the best {@link NullaryHybridCF} implementation to use will be selected
  *     automatically from the type and arguments.
  * @param out The typed output.
  * @param otherArgs The operation's arguments, excluding the typed output value.
  * @return A {@link NullaryHybridCF} with populated inputs, ready to use.
  */
 @SuppressWarnings("unchecked")
 public static <O, OP extends Op> NullaryHybridCF<O> nullaryCF(
     final OpEnvironment ops, final Class<OP> opType, final O out, final Object... otherArgs) {
   final Object[] args = OpUtils.args(otherArgs, out);
   final OpRef<OP> ref = OpRef.createTypes(opType, NullaryHybridCF.class, null, args);
   return (NullaryHybridCF<O>) ops.op(ref);
 }
Ejemplo n.º 2
0
 /**
  * Gets the best {@link BinaryHybridCF} implementation for the given types and arguments,
  * populating its inputs.
  *
  * @param ops The {@link OpEnvironment} to search for a matching op.
  * @param opType The {@link Class} of the operation. If multiple {@link BinaryHybridCF}s share
  *     this type (e.g., the type is an interface which multiple {@link BinaryHybridCF}s
  *     implement), then the best {@link BinaryHybridCF} implementation to use will be selected
  *     automatically from the type and arguments.
  * @param out The typed output.
  * @param in1 The first typed input.
  * @param in2 The second typed input.
  * @param otherArgs The operation's arguments, excluding the typed inputs and output values.
  * @return A {@link BinaryHybridCF} with populated inputs, ready to use.
  */
 @SuppressWarnings("unchecked")
 public static <I1, I2, O, OP extends Op> BinaryHybridCF<I1, I2, O> binaryCF(
     final OpEnvironment ops,
     final Class<OP> opType,
     final O out,
     final I1 in1,
     final I2 in2,
     final Object... otherArgs) {
   final Object[] args = OpUtils.args(otherArgs, out, in1, in2);
   final OpRef<OP> ref = OpRef.createTypes(opType, BinaryHybridCF.class, null, args);
   return (BinaryHybridCF<I1, I2, O>) ops.op(ref);
 }