mirror of
https://github.com/DanilaFe/abacus
synced 2026-01-26 08:35:20 +00:00
Add stop button
This commit is contained in:
@@ -92,10 +92,19 @@ public class BinaryNode extends TreeNode {
|
||||
|
||||
@Override
|
||||
public <T> T reduce(Reducer<T> reducer) {
|
||||
if(Thread.currentThread().isInterrupted())
|
||||
return null;
|
||||
T leftReduce = left.reduce(reducer);
|
||||
if(Thread.currentThread().isInterrupted())
|
||||
return null;
|
||||
T rightReduce = right.reduce(reducer);
|
||||
if (leftReduce == null || rightReduce == null) return null;
|
||||
return reducer.reduceNode(this, leftReduce, rightReduce);
|
||||
if(Thread.currentThread().isInterrupted())
|
||||
return null;
|
||||
T a = reducer.reduceNode(this, leftReduce, rightReduce);
|
||||
if(Thread.currentThread().isInterrupted())
|
||||
return null;
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user