-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
2,000 additions
and
2,427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
scijava-ops-engine/src/main/java/org/scijava/ops/engine/describe/PrimitiveDescriptors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
package org.scijava.ops.engine.describe; | ||
|
||
import org.scijava.ops.spi.OpCollection; | ||
import org.scijava.ops.spi.OpField; | ||
import org.scijava.priority.Priority; | ||
import org.scijava.types.Types; | ||
|
||
import java.util.List; | ||
|
||
public class PrimitiveDescriptors<T, N extends Number> implements OpCollection { | ||
|
||
@OpField(names = "engine.describe") | ||
public final TypeDescriptor<N> boxedPrimitiveDescriptor = in -> "number"; | ||
|
||
@OpField(names = "engine.describe") | ||
public final TypeDescriptor<N[]> boxedPrimitiveArrayDescriptor = | ||
in -> "number[]"; | ||
|
||
@OpField(names = "engine.describe") | ||
public final TypeDescriptor<byte[]> byteArrayDescriptor = in -> "number[]"; | ||
|
||
@OpField(names = "engine.describe") | ||
public final TypeDescriptor<short[]> shortArrayDescriptor = in -> "number[]"; | ||
|
||
@OpField(names = "engine.describe") | ||
public final TypeDescriptor<int[]> intArrayDescriptor = in -> "number[]"; | ||
|
||
@OpField(names = "engine.describe") | ||
public final TypeDescriptor<long[]> longArrayDescriptor = in -> "number[]"; | ||
|
||
@OpField(names = "engine.describe") | ||
public final TypeDescriptor<float[]> floatArrayDescriptor = in -> "number[]"; | ||
|
||
@OpField(names = "engine.describe") | ||
public final TypeDescriptor<double[]> doubleArrayDescriptor = | ||
in -> "number[]"; | ||
|
||
@OpField(names = "engine.describe") | ||
public final TypeDescriptor<List<N>> boxedPrimitiveListDescriptor = | ||
in -> "list<number>"; | ||
|
||
@OpField(names = "engine.describe", priority = Priority.LAST) | ||
public final TypeDescriptor<T> identityDescriptor = in -> Types.raw(in | ||
.getType()).getSimpleName(); | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
scijava-ops-engine/src/main/java/org/scijava/ops/engine/describe/TypeDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
package org.scijava.ops.engine.describe; | ||
|
||
import org.scijava.types.Nil; | ||
|
||
import java.util.function.Function; | ||
|
||
/** | ||
* Convenience interface for describing an Op that turns a type into a | ||
* {@link String} | ||
* | ||
* @param <T> the type that this {@code TypeDescriptor} describes | ||
* @author Gabriel Selzer | ||
*/ | ||
public interface TypeDescriptor<T> extends Function<Nil<T>, String> {} |
Oops, something went wrong.