|
12 | 12 |
|
13 | 13 | import java.util.function.Function; |
14 | 14 |
|
15 | | -public class ImgLib2Descriptors< // |
16 | | - A, // |
17 | | - C extends ComplexType<C>, // |
18 | | - I extends IntegerType<I>, // |
19 | | - T extends RealType<T> // |
20 | | -> { |
| 15 | +/** |
| 16 | + * {@code engine.describe} Ops pertaining to ImgLib2 types. |
| 17 | + * <p> |
| 18 | + * Note that each input is a {@code Nil<T>}, where {@code T} is a type variable |
| 19 | + * bounded by the type we actually want to describe. This provides |
| 20 | + * extensibility, as it allows e.g. {@link #raiDesc(Nil)} to be used for e.g. |
| 21 | + * {@link net.imglib2.img.array.ArrayImg}s |
| 22 | + * </p> |
| 23 | + * |
| 24 | + * @author Gabriel Selzer |
| 25 | + */ |
| 26 | +public class ImgLib2Descriptors { |
21 | 27 |
|
22 | 28 | /** |
23 | | - * @input the type to describe |
24 | | - * @output the description |
| 29 | + * @param in the type to describe |
| 30 | + * @return the description |
25 | 31 | * @implNote op name="engine.describe" |
26 | 32 | */ |
27 | | - public final Function<Nil<IterableInterval<A>>, String> iiDesc = // |
28 | | - in -> "image"; |
| 33 | + public static <A, T extends IterableInterval<A>> String iiDesc( // |
| 34 | + Nil<T> in // |
| 35 | + ) { |
| 36 | + return "image"; |
| 37 | + } |
29 | 38 |
|
30 | 39 | /** |
31 | | - * @input the type to describe |
32 | | - * @output the description |
33 | | - * @implNote op name="engine.describe", priority="100." |
| 40 | + * @param in the type to describe |
| 41 | + * @return the description |
| 42 | + * @implNote op name="engine.describe", priority='100.' |
34 | 43 | */ |
35 | | - public final Function<Nil<RandomAccessibleInterval<A>>, String> raiDesc = // |
36 | | - in -> "image"; |
| 44 | + public static <A, T extends RandomAccessibleInterval<A>> String raiDesc( // |
| 45 | + Nil<T> in // |
| 46 | + ) { |
| 47 | + return "image"; |
| 48 | + } |
37 | 49 |
|
38 | 50 | /** |
39 | | - * @input the type to describe |
40 | | - * @output the description |
41 | | - * @implNote op name="engine.describe", priority="1000." |
| 51 | + * @param in the type to describe |
| 52 | + * @return the description |
| 53 | + * @implNote op name="engine.describe", priority='10000.' |
42 | 54 | */ |
43 | | - public final Function<Nil<ImgLabeling<A, I>>, String> imgLabelDesc = // |
44 | | - in -> "labels"; |
| 55 | + public static <A, I extends IntegerType<I>, T extends ImgLabeling<A, I>> |
| 56 | + String labelDesc(Nil<T> in) |
| 57 | + { |
| 58 | + return "labels"; |
| 59 | + } |
45 | 60 |
|
46 | 61 | /** |
47 | | - * @input the type to describe |
48 | | - * @output the description |
| 62 | + * @param in the type to describe |
| 63 | + * @return the description |
49 | 64 | * @implNote op name="engine.describe", priority='100.' |
50 | 65 | */ |
51 | | - public final Function<Nil<T>, String> realTypeDesc = // |
52 | | - in -> "number"; |
| 66 | + public static <T extends RealType<T>> String realTypeDesc( // |
| 67 | + Nil<T> in // |
| 68 | + ) { |
| 69 | + return "number"; |
| 70 | + } |
53 | 71 |
|
54 | 72 | /** |
55 | | - * @input the type to describe |
56 | | - * @output the description |
| 73 | + * @param in the type to describe |
| 74 | + * @return the description |
57 | 75 | * @implNote op name="engine.describe" |
58 | 76 | */ |
59 | | - public final Function<Nil<C>, String> complexTypeDesc = // |
60 | | - in -> "complex number"; |
| 77 | + public static <T extends ComplexType<T>> String complexTypeDesc( // |
| 78 | + Nil<T> in // |
| 79 | + ) { |
| 80 | + return "complex number"; |
| 81 | + } |
61 | 82 | } |
0 commit comments