Search in sources :

Example 1 with CommandInfo

use of org.scijava.command.CommandInfo in project imagej-ops by imagej.

the class CachedOpEnvironment method otherArgs.

/**
 * Gets the given {@link Op} instance's argument value, starting at the
 * specified offset.
 */
private Object[] otherArgs(final Op op, final int offset) {
    final CommandInfo cInfo = info(op).cInfo();
    final Module module = cInfo.createModule(op);
    final ArrayList<Object> args = new ArrayList<>();
    int i = 0;
    for (final ModuleItem<?> input : cInfo.inputs()) {
        if (i++ >= offset)
            args.add(input.getValue(module));
    }
    return args.toArray();
}
Also used : CommandInfo(org.scijava.command.CommandInfo) ArrayList(java.util.ArrayList) Module(org.scijava.module.Module)

Aggregations

ArrayList (java.util.ArrayList)1 CommandInfo (org.scijava.command.CommandInfo)1 Module (org.scijava.module.Module)1