Skip to content

Commit 3648c07

Browse files
committed
CallingOps: improve the type-based matching section
1 parent 06c2093 commit 3648c07

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docs/ops/doc/CallingOps.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,14 @@ While we do pass concrete inputs and outputs in this example, they are essential
9090

9191
*Note that the default `OpEnvironment` implementations cache Op requests* - this means that repeated `OpBuilder` requests targeting the same action will be faster than the original matching call.
9292

93-
### Matching with classes
93+
### Matching with types/classes
9494

9595
In addition to the `.input()` and `.output()` builder steps, there are parallel `.inType()` and `.outType()`
9696
methods. These accept either a `Class` or a `Nil` - the latter allowing retention of generic types.
97+
These methods makes it possible to search for an Op without actually having an instance of the objects
98+
you (eventually) plan to operate upon. For example, you might want to look up the `filter.gauss` Op that
99+
would be used to smooth an `ImgPlus` by a particular `double` value, without actually having an `ImgPlus`
100+
image available to pass to the builder request:
97101

98102
```java
99103
var computer = ops.op("filter.gauss").inType(ImgPlus.class, Double.class).outType(ImgPlus.class).computer()

0 commit comments

Comments
 (0)