Skip to content

Commit 49d1351

Browse files
committed
Add BlockSupplier.andThen(...) with operator-generating Function
1 parent a36ab43 commit 49d1351

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/net/imglib2/algorithm/blocks/BlockSupplier.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import static net.imglib2.util.Util.safeInt;
3838

3939
import java.util.Arrays;
40+
import java.util.function.Function;
4041

4142
import net.imglib2.EuclideanSpace;
4243
import net.imglib2.Interval;
@@ -146,6 +147,11 @@ default < U extends NativeType< U > > BlockSupplier< U > andThen( UnaryBlockOper
146147
return new ConcatenatedBlockSupplier<>( this.independentCopy(), operator.independentCopy() );
147148
}
148149

150+
default < U extends NativeType< U > > BlockSupplier< U > andThen( Function< BlockSupplier< T >, UnaryBlockOperator< T, U > > function )
151+
{
152+
return new ConcatenatedBlockSupplier<>( this.independentCopy(), function.apply( this ) );
153+
}
154+
149155
/**
150156
* Create a {@code BlockSupplier} accessor for an arbitrary {@code
151157
* RandomAccessible} source. Many View constructions (that ultimately end in

0 commit comments

Comments
 (0)