Package extra166y
Class ParallelDoubleArrayWithFilter
java.lang.Object
extra166y.AbstractParallelAnyArray
extra166y.ParallelDoubleArrayWithDoubleMapping
extra166y.ParallelDoubleArrayWithFilter
- Direct Known Subclasses:
ParallelDoubleArrayWithBounds
A prefix view of ParallelDoubleArray that causes operations to apply
only to elements for which a selector returns true.
Instances of this class may be constructed only via prefix
methods of ParallelDoubleArray or its other prefix classes.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a new ParallelDoubleArray containing only unique elements (that is, without any duplicates).boolean
Returns true if all elements at the same relative positions of this and other array are equal.replaceWithGeneratedValue
(Ops.DoubleGenerator generator) Replaces elements with results of applying the given generator.Replaces elements with the results of applying the given mapping to each index and current element valueReplaces elements with the results of applying the given op to their indicesreplaceWithMapping
(Ops.BinaryDoubleOp combiner, double[] other) Replaces elements with results of applying op(thisElement, otherElement)replaceWithMapping
(Ops.BinaryDoubleOp combiner, ParallelDoubleArrayWithDoubleMapping other) Replaces elements with results of applying op(thisElement, otherElement)Replaces elements with the results of applying the given op to their current values.replaceWithValue
(double value) Replaces elements with the given value.withFilter
(Ops.BinaryDoublePredicate selector, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given binary selector returns trueabstract ParallelDoubleArrayWithFilter
withFilter
(Ops.DoublePredicate selector) Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given selector returns trueabstract ParallelDoubleArrayWithFilter
withIndexedFilter
(Ops.IntAndDoublePredicate selector) Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given indexed selector returns trueMethods inherited from class extra166y.ParallelDoubleArrayWithDoubleMapping
all, apply, max, max, min, min, reduce, sequentially, sum, summary, summary, withIndexedMapping, withIndexedMapping, withIndexedMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping
Methods inherited from class extra166y.AbstractParallelAnyArray
anyIndex, isEmpty, size
-
Method Details
-
replaceWithMapping
Replaces elements with the results of applying the given op to their current values.- Parameters:
op
- the op- Returns:
- this (to simplify use in expressions)
-
replaceWithMappedIndex
Replaces elements with the results of applying the given op to their indices- Parameters:
op
- the op- Returns:
- this (to simplify use in expressions)
-
replaceWithMappedIndex
Replaces elements with the results of applying the given mapping to each index and current element value- Parameters:
op
- the op- Returns:
- this (to simplify use in expressions)
-
replaceWithGeneratedValue
Replaces elements with results of applying the given generator.- Parameters:
generator
- the generator- Returns:
- this (to simplify use in expressions)
-
replaceWithValue
Replaces elements with the given value.- Parameters:
value
- the value- Returns:
- this (to simplify use in expressions)
-
replaceWithMapping
public ParallelDoubleArrayWithFilter replaceWithMapping(Ops.BinaryDoubleOp combiner, ParallelDoubleArrayWithDoubleMapping other) Replaces elements with results of applying op(thisElement, otherElement)- Parameters:
other
- the other arraycombiner
- the combiner- Returns:
- this (to simplify use in expressions)
-
replaceWithMapping
public ParallelDoubleArrayWithFilter replaceWithMapping(Ops.BinaryDoubleOp combiner, double[] other) Replaces elements with results of applying op(thisElement, otherElement)- Parameters:
other
- the other arraycombiner
- the combiner- Returns:
- this (to simplify use in expressions)
-
allUniqueElements
Returns a new ParallelDoubleArray containing only unique elements (that is, without any duplicates).- Returns:
- the new ParallelDoubleArray
-
withFilter
Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given selector returns true- Parameters:
selector
- the selector- Returns:
- operation prefix
-
withFilter
public ParallelDoubleArrayWithFilter withFilter(Ops.BinaryDoublePredicate selector, ParallelDoubleArrayWithDoubleMapping other) Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given binary selector returns true- Parameters:
selector
- the selector- Returns:
- operation prefix
-
withIndexedFilter
Returns an operation prefix that causes a method to operate only on elements for which the current selector (if present) and the given indexed selector returns true- Parameters:
selector
- the selector- Returns:
- operation prefix
-
hasAllEqualElements
Returns true if all elements at the same relative positions of this and other array are equal.- Parameters:
other
- the other array- Returns:
- true if equal
-