org.codehaus.gpars

groovyx.gpars.extra166y
[Java] Class ParallelArrayWithFilter

java.lang.Object
  AbstractParallelAnyArray.OPap
      groovyx.gpars.extra166y.ParallelArrayWithMapping
          groovyx.gpars.extra166y.ParallelArrayWithFilter

public abstract class ParallelArrayWithFilter
extends ParallelArrayWithMapping

A prefix view of ParallelArray 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 ParallelArray or its other prefix classes.


Constructor Summary
ParallelArrayWithFilter(ForkJoinPool ex, int origin, int fence, java.lang.Object[] array)

 
Method Summary
ParallelArray allNonidenticalElements()

Returns a new ParallelArray containing only non-null unique elements (that is, without any duplicates).

ParallelArray allUniqueElements()

Returns a new ParallelArray containing only non-null unique elements (that is, without any duplicates).

boolean hasAllEqualElements(ParallelArrayWithMapping other)

Returns true if all elements at the same relative positions of this and other array are equal.

boolean hasAllIdenticalElements(ParallelArrayWithMapping other)

Returns true if all elements at the same relative positions of this and other array are identical.

void leafTransfer(int lo, int hi, java.lang.Object[] dest, int offset)

void leafTransferByIndex(int[] indices, int loIdx, int hiIdx, java.lang.Object[] dest, int offset)

java.lang.Object oget(int i)

ParallelArrayWithFilter replaceWithGeneratedValue(Generator generator)

Replaces elements with results of applying the given generator.

ParallelArrayWithFilter replaceWithMappedIndex(IntToObject op)

Replaces elements with the results of applying the given op to their indices

ParallelArrayWithFilter replaceWithMappedIndex(IntAndObjectToObject op)

Replaces elements with the results of applying the given mapping to each index and current element value

ParallelArrayWithFilter replaceWithMapping(Op op)

Replaces elements with the results of applying the given op to their current values.

ParallelArrayWithFilter replaceWithMapping(BinaryOp combiner, ParallelArrayWithMapping other)

Replaces elements with results of applying op(thisElement, otherElement)

ParallelArrayWithFilter replaceWithMapping(BinaryOp combiner, java.lang.Object[] other)

Replaces elements with results of applying op(thisElement, otherElement)

ParallelArrayWithFilter replaceWithValue(java.lang.Object value)

Replaces elements with the given value.

ParallelArrayWithFilter withFilter(Predicate 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 true

ParallelArrayWithFilter withFilter(BinaryPredicate selector, ParallelArrayWithMapping 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

ParallelArrayWithFilter withIndexedFilter(IntAndObjectPredicate 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 true

 
Methods inherited from class ParallelArrayWithMapping
all, all, any, apply, max, max, min, min, reduce, sequentially, summary, summary, withIndexedMapping, withIndexedMapping, withIndexedMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping, withMapping
 

Constructor Detail

ParallelArrayWithFilter

ParallelArrayWithFilter(ForkJoinPool ex, int origin, int fence, java.lang.Object[] array)


 
Method Detail

allNonidenticalElements

public ParallelArray allNonidenticalElements()
Returns a new ParallelArray containing only non-null unique elements (that is, without any duplicates). This method uses reference identity to test for duplication.
Returns:
the new ParallelArray


allUniqueElements

public ParallelArray allUniqueElements()
Returns a new ParallelArray containing only non-null unique elements (that is, without any duplicates). This method uses each element's equals method to test for duplication.
Returns:
the new ParallelArray


hasAllEqualElements

public boolean hasAllEqualElements(ParallelArrayWithMapping other)
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


hasAllIdenticalElements

public boolean hasAllIdenticalElements(ParallelArrayWithMapping other)
Returns true if all elements at the same relative positions of this and other array are identical.
Parameters:
other - the other array
Returns:
true if equal


leafTransfer

final void leafTransfer(int lo, int hi, java.lang.Object[] dest, int offset)


leafTransferByIndex

final void leafTransferByIndex(int[] indices, int loIdx, int hiIdx, java.lang.Object[] dest, int offset)


oget

final java.lang.Object oget(int i)


replaceWithGeneratedValue

public ParallelArrayWithFilter replaceWithGeneratedValue(Generator generator)
Replaces elements with results of applying the given generator.
Parameters:
generator - the generator
Returns:
this (to simplify use in expressions)


replaceWithMappedIndex

public ParallelArrayWithFilter replaceWithMappedIndex(IntToObject op)
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

public ParallelArrayWithFilter replaceWithMappedIndex(IntAndObjectToObject op)
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)


replaceWithMapping

public ParallelArrayWithFilter replaceWithMapping(Op op)
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)


replaceWithMapping

public ParallelArrayWithFilter replaceWithMapping(BinaryOp combiner, ParallelArrayWithMapping other)
Replaces elements with results of applying op(thisElement, otherElement)
Parameters:
other - the other array
combiner - the combiner
Returns:
this (to simplify use in expressions)


replaceWithMapping

public ParallelArrayWithFilter replaceWithMapping(BinaryOp combiner, java.lang.Object[] other)
Replaces elements with results of applying op(thisElement, otherElement)
Parameters:
other - the other array
combiner - the combiner
Returns:
this (to simplify use in expressions)


replaceWithValue

public ParallelArrayWithFilter replaceWithValue(java.lang.Object value)
Replaces elements with the given value.
Parameters:
value - the value
Returns:
this (to simplify use in expressions)


withFilter

public ParallelArrayWithFilter withFilter(Predicate 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 true
Parameters:
selector - the selector
Returns:
operation prefix


withFilter

public ParallelArrayWithFilter withFilter(BinaryPredicate selector, ParallelArrayWithMapping 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

public ParallelArrayWithFilter withIndexedFilter(IntAndObjectPredicate 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 true
Parameters:
selector - the selector
Returns:
operation prefix


 

Copyright © 2008–2012 Václav Pech. All Rights Reserved.