--- jsr166/src/extra166y/AbstractParallelAnyArray.java 2013/01/18 04:23:27 1.12 +++ jsr166/src/extra166y/AbstractParallelAnyArray.java 2015/01/18 20:17:32 1.18 @@ -5,6 +5,7 @@ */ package extra166y; + import jsr166y.*; import static extra166y.Ops.*; import java.util.*; @@ -132,7 +133,7 @@ public abstract class AbstractParallelAn */ Object[] ogetArray() { return null; } double[] dgetArray() { return null; } - long[] lgetArray() { return null; } + long[] lgetArray() { return null; } abstract Object oget(int index); abstract double dget(int index); abstract long lget(int index); @@ -145,6 +146,7 @@ public abstract class AbstractParallelAn * oget, dget, etc. But most are overridden in most concrete * classes to avoid per-element dispatching. */ + void leafApply(int lo, int hi, Procedure procedure) { for (int i = lo; i < hi; ++i) if (isSelected(i)) @@ -274,7 +276,7 @@ public abstract class AbstractParallelAn /** * Shared support for select/map all -- probe filter, map, and * type to start selection driver, or do parallel mapping, or - * just copy, + * just copy. */ final Object[] allObjects(Class elementType) { if (hasFilter()) { @@ -513,7 +515,7 @@ public abstract class AbstractParallelAn return new ORPap(ex, origin, fence, array, selector); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (Op op) { return new OUOMPap(ex, origin, fence, array, op); } @@ -1169,7 +1171,7 @@ public abstract class AbstractParallelAn compoundIndexedSelector(this.selector, selector)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (Op op) { return new OFOMPap(ex, origin, fence, array, selector, op); } @@ -1710,7 +1712,7 @@ public abstract class AbstractParallelAn compoundIndexedSelector(this.selector, selector)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (Op op) { return new OROMPap(ex, origin, fence, array, selector, op); } @@ -2324,7 +2326,7 @@ public abstract class AbstractParallelAn super(ex, origin, fence, array, op); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (Op op) { return new OUOMPap(ex, origin, fence, array, CommonOps.compoundOp(this.op, op)); @@ -2518,7 +2520,7 @@ public abstract class AbstractParallelAn boolean hasFilter() { return true; } boolean isSelected(int i) { return selector.op(this.array[i]); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (Op op) { return new OFOMPap (ex, origin, fence, array, selector, @@ -2773,7 +2775,7 @@ public abstract class AbstractParallelAn boolean hasFilter() { return true; } boolean isSelected(int i) { return selector.op(i, this.array[i]); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (Op op) { return new OROMPap (ex, origin, fence, array, selector, @@ -3115,7 +3117,7 @@ public abstract class AbstractParallelAn super(ex, origin, fence, array, op); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (Op op) { return new OUOCPap(ex, origin, fence, array, compoundIndexedOp(this.op, op)); @@ -3309,7 +3311,7 @@ public abstract class AbstractParallelAn boolean hasFilter() { return true; } boolean isSelected(int i) { return selector.op(this.array[i]); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (Op op) { return new OFOCPap(ex, origin, fence, array, selector, compoundIndexedOp(this.op, op)); @@ -3552,7 +3554,7 @@ public abstract class AbstractParallelAn boolean hasFilter() { return true; } boolean isSelected(int i) { return selector.op(i, this.array[i]); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (Op op) { return new OROCPap(ex, origin, fence, array, selector, compoundIndexedOp(this.op, op)); @@ -3892,7 +3894,7 @@ public abstract class AbstractParallelAn CommonOps.compoundOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (DoubleToObject op) { return new OUOMPap(ex, origin, fence, array, CommonOps.compoundOp(this.op, op)); @@ -4080,7 +4082,7 @@ public abstract class AbstractParallelAn CommonOps.compoundOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (DoubleToObject op) { return new OFOMPap(ex, origin, fence, array, selector, CommonOps.compoundOp(this.op, op)); @@ -4316,7 +4318,7 @@ public abstract class AbstractParallelAn CommonOps.compoundOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (DoubleToObject op) { return new OROMPap(ex, origin, fence, array, selector, CommonOps.compoundOp(this.op, op)); @@ -4641,7 +4643,7 @@ public abstract class AbstractParallelAn compoundIndexedOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (DoubleToObject op) { return new OUOCPap(ex, origin, fence, array, compoundIndexedOp(this.op, op)); @@ -4828,7 +4830,7 @@ public abstract class AbstractParallelAn compoundIndexedOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (DoubleToObject op) { return new OFOCPap(ex, origin, fence, array, selector, compoundIndexedOp(this.op, op)); @@ -5066,7 +5068,7 @@ public abstract class AbstractParallelAn compoundIndexedOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (DoubleToObject op) { return new OROCPap(ex, origin, fence, array, selector, compoundIndexedOp(this.op, op)); @@ -5387,7 +5389,7 @@ public abstract class AbstractParallelAn CommonOps.compoundOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (LongToObject op) { return new OUOMPap(ex, origin, fence, array, CommonOps.compoundOp(this.op, op)); @@ -5576,7 +5578,7 @@ public abstract class AbstractParallelAn CommonOps.compoundOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (LongToObject op) { return new OFOMPap(ex, origin, fence, array, selector, CommonOps.compoundOp(this.op, op)); @@ -5816,7 +5818,7 @@ public abstract class AbstractParallelAn CommonOps.compoundOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (LongToObject op) { return new OROMPap(ex, origin, fence, array, selector, CommonOps.compoundOp(this.op, op)); @@ -6142,7 +6144,7 @@ public abstract class AbstractParallelAn compoundIndexedOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (LongToObject op) { return new OUOCPap(ex, origin, fence, array, compoundIndexedOp(this.op, op)); @@ -6327,7 +6329,7 @@ public abstract class AbstractParallelAn compoundIndexedOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (LongToObject op) { return new OFOCPap(ex, origin, fence, array, selector, @@ -6569,7 +6571,7 @@ public abstract class AbstractParallelAn compoundIndexedOp(this.op, op)); } - public ParallelArrayWithMapping withMapping + public ParallelArrayWithMapping withMapping (LongToObject op) { return new OROCPap(ex, origin, fence, array, selector, @@ -6819,7 +6821,7 @@ public abstract class AbstractParallelAn int cursor; FilteredAsDoubleIterator() { cursor = origin; - advance() ; + advance(); } private void advance() { while (cursor < fence) { @@ -6872,7 +6874,7 @@ public abstract class AbstractParallelAn int cursor; FilteredAsLongIterator() { cursor = origin; - advance() ; + advance(); } private void advance() { while (cursor < fence) { @@ -6925,7 +6927,7 @@ public abstract class AbstractParallelAn int cursor; FilteredIterator() { cursor = origin; - advance() ; + advance(); } private void advance() { while (cursor < fence) {