public class DefaultOpMatchingService extends AbstractService implements OpMatchingService
Op
s which match a request.Constructor and Description |
---|
DefaultOpMatchingService() |
Modifier and Type | Method and Description |
---|---|
Module |
assignInputs(Module module,
Object... args)
Assigns arguments into the given module's inputs.
|
List<OpCandidate> |
filterMatches(List<OpCandidate> candidates)
Filters a list of ops to those matching the given arguments.
|
List<OpCandidate> |
findCandidates(OpEnvironment ops,
List<OpRef> refs)
Builds a list of candidate ops which might match one of the given op
references.
|
List<OpCandidate> |
findCandidates(OpEnvironment ops,
OpRef ref)
Builds a list of candidate ops which might match the given op reference.
|
OpCandidate |
findMatch(OpEnvironment ops,
List<OpRef> refs)
Finds and initializes the best module matching any of the given op name
and/or type + arguments.
|
OpCandidate |
findMatch(OpEnvironment ops,
OpRef ref)
Finds and initializes the best module matching the given op name and/or
type + arguments.
|
Module |
match(OpCandidate candidate)
Attempts to match the given arguments to the
Op described by the
specified ModuleInfo . |
Object[] |
padArgs(OpCandidate candidate)
Checks the number of args, padding optional args with null as needed.
|
boolean |
typesMatch(OpCandidate candidate)
Checks that each parameter is type-compatible with its corresponding
argument.
|
getContext, setContext, toString
getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
initialize, registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
public OpCandidate findMatch(OpEnvironment ops, OpRef ref)
OpMatchingService
OpCandidate
containing the matching module
will be returned.findMatch
in interface OpMatchingService
ops
- The pool from which candidate ops should be drawn.ref
- The op reference describing the op to match.OpCandidate
containing the module which wraps the best
Op
, with populated inputs, ready to run.public OpCandidate findMatch(OpEnvironment ops, List<OpRef> refs)
OpMatchingService
OpCandidate
containing the matching
module will be returned.findMatch
in interface OpMatchingService
ops
- The pool from which candidate ops should be drawn.refs
- The op references describing the op to match.OpCandidate
containing the module which wraps the best
Op
, with populated inputs, ready to run.public List<OpCandidate> findCandidates(OpEnvironment ops, OpRef ref)
OpMatchingService
findCandidates
in interface OpMatchingService
ops
- The pool from which candidate ops should be drawn.ref
- The op reference describing the op to match.public List<OpCandidate> findCandidates(OpEnvironment ops, List<OpRef> refs)
OpMatchingService
findCandidates
in interface OpMatchingService
ops
- The pool from which candidate ops should be drawn.refs
- The op references describing the op to match.public List<OpCandidate> filterMatches(List<OpCandidate> candidates)
OpMatchingService
filterMatches
in interface OpMatchingService
candidates
- The list of op candidates to scan for matches.Module
instances attached.public Module match(OpCandidate candidate)
OpMatchingService
Op
described by the
specified ModuleInfo
.match
in interface OpMatchingService
Module
instance for the matching Op
, or
null if the arguments do not match the Op
.public boolean typesMatch(OpCandidate candidate)
OpMatchingService
typesMatch
in interface OpMatchingService
public Module assignInputs(Module module, Object... args)
OpMatchingService
assignInputs
in interface OpMatchingService
public Object[] padArgs(OpCandidate candidate)
OpMatchingService
padArgs
in interface OpMatchingService
Copyright © 2014–2022 ImageJ. All rights reserved.