|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgroovyx.gpars.extra166y.AbstractParallelAnyArray
groovyx.gpars.extra166y.AbstractParallelAnyArray.LPap
groovyx.gpars.extra166y.ParallelLongArrayWithLongMapping
groovyx.gpars.extra166y.ParallelLongArrayWithFilter
groovyx.gpars.extra166y.ParallelLongArrayWithBounds
groovyx.gpars.extra166y.AbstractParallelAnyArray.LUPap
groovyx.gpars.extra166y.ParallelLongArray
public class ParallelLongArray
An array of longs supporting parallel operations. This class
provides methods supporting the same operations as ParallelArray, but specialized for scalar longs. It additionally
provides a few methods specific to numerical values.
Sample usages. Here is a complete (although naive) prime filter program:
import java.math.BigInteger;
import jsr166y.*;
import static extra166y.Ops.*;
import static extra166y.ParallelLongArray.*;
public class Sieve {
public static void main(String[] args) {
int n = Integer.parseInt(args[0]);
// create array of divisors
ParallelLongArray a = create(n-1, defaultExecutor());
a.replaceWithMappedIndex(add2);
int i = 0;
long p = 2;
while (p * p < n) { // repeatedly filter
a = a.withFilter(notDivisibleBy(p)).all();
p = a.get(++i);
}
System.out.printf("sieve(%d) = %s%n", n, a);
// check result
if (!a.withFilter(notProbablePrime).isEmpty())
throw new Error();
}
static IntToLong add2 = new IntToLong() {
public long op(int i) { return i + 2; } };
static LongPredicate notDivisibleBy(final long p) {
return new LongPredicate() {
public boolean op(long n) { return n <= p || (n % p) != 0; }
}; }
static LongPredicate notProbablePrime = new LongPredicate() {
private static final int CERTAINTY = 8;
public boolean op(long n) {
return !BigInteger.valueOf(n).isProbablePrime(CERTAINTY);
}
};
}
| Nested Class Summary | |
|---|---|
(package private) class |
ParallelLongArray.AsList
|
(package private) class |
ParallelLongArray.ListIter
|
(package private) static class |
ParallelLongArray.ParallelLongArrayIterator
|
static interface |
ParallelLongArray.SummaryStatistics
Summary statistics for a possibly bounded, filtered, and/or mapped ParallelLongArray. |
| Field Summary | |
|---|---|
(package private) ParallelLongArray.AsList |
listView
|
| Fields inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray.LPap |
|---|
array |
| Fields inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray |
|---|
ex, fence, origin, threshold |
| Constructor Summary | |
|---|---|
(package private) |
ParallelLongArray(jsr166y.ForkJoinPool executor,
long[] array)
Trusted internal version of protected constructor. |
protected |
ParallelLongArray(jsr166y.ForkJoinPool executor,
long[] array,
int limit)
Constructor for use by subclasses to create a new ParallelLongArray using the given executor, and initially using the supplied array, with effective size bound by the given limit. |
| Method Summary | ||
|---|---|---|
ParallelLongArray |
addAll(long[] other)
Equivalent to asList().addAll but specialized for array arguments and likely to be more efficient. |
|
ParallelLongArray |
addAll(ParallelLongArrayWithLongMapping other)
Appends all (possibly bounded, filtered, or mapped) elements of the given ParallelDoubleArray, resizing and/or reallocating this array if necessary. |
|
ParallelLongArray |
all()
Returns a new ParallelLongArray holding all elements |
|
ParallelLongArray |
allUniqueElements()
Returns a new ParallelLongArray containing only the unique elements of this array (that is, without any duplicates). |
|
(package private) void |
appendElement(long e)
|
|
void |
apply(Ops.LongProcedure procedure)
Applies the given procedure to elements |
|
java.util.List<java.lang.Long> |
asList()
Returns a view of this ParallelLongArray as a List. |
|
int |
binarySearch(long target)
Assuming this array is sorted, returns the index of an element equal to given target, or -1 if not present. |
|
int |
binarySearch(long target,
Ops.LongComparator comparator)
Assuming this array is sorted with respect to the given comparator, returns the index of an element equal to given target, or -1 if not present. |
|
static ParallelLongArray |
create(int size,
jsr166y.ForkJoinPool executor)
Creates a new ParallelLongArray using the given executor and an array of the given size |
|
static ParallelLongArray |
createEmpty(int size,
jsr166y.ForkJoinPool executor)
Creates a new ParallelLongArray using the given executor and an array of the given size, but with an initial effective size of zero, enabling incremental insertion via asList() operations. |
|
static ParallelLongArray |
createFromCopy(int size,
long[] source,
jsr166y.ForkJoinPool executor)
Creates a new ParallelLongArray using an array of the given size, initially holding copies of the given source truncated or padded with zeros to obtain the specified length. |
|
static ParallelLongArray |
createFromCopy(long[] source,
jsr166y.ForkJoinPool executor)
Creates a new ParallelLongArray using the given executor and initially holding copies of the given source elements. |
|
static ParallelLongArray |
createUsingHandoff(long[] handoff,
jsr166y.ForkJoinPool executor)
Creates a new ParallelLongArray initially using the given array and executor. |
|
ParallelLongArray |
cumulate(Ops.LongReducer reducer,
long base)
Replaces each element with the running cumulation of applying the given reducer. |
|
ParallelLongArray |
cumulateSum()
Replaces each element with the running sum |
|
static jsr166y.ForkJoinPool |
defaultExecutor()
Returns a common default executor for use in ParallelArrays. |
|
long |
get(int i)
Returns the element of the array at the given index |
|
long[] |
getArray()
Returns the underlying array used for computations |
|
jsr166y.ForkJoinPool |
getExecutor()
Returns the executor used for computations |
|
boolean |
hasAllEqualElements(ParallelLongArrayWithLongMapping other)
Returns true if all elements at the same relative positions of this and other array are equal. |
|
int |
indexOf(long target)
Returns the index of some element equal to given target, or -1 if not present |
|
(package private) void |
insertElementAt(int index,
long e)
|
|
(package private) void |
insertSlotsAt(int index,
int len)
Makes len slots available at index. |
|
java.util.Iterator<java.lang.Long> |
iterator()
Returns an iterator stepping through each element of the array up to the current limit. |
|
long |
max()
Returns the maximum element, or Long.MIN_VALUE if empty |
|
long |
max(Ops.LongComparator comparator)
Returns the maximum element, or Long.MIN_VALUE if empty |
|
long |
min()
Returns the minimum element, or Long.MAX_VALUE if empty, |
|
long |
min(Ops.LongComparator comparator)
Returns the minimum element, or Long.MAX_VALUE if empty |
|
long |
precumulate(Ops.LongReducer reducer,
long base)
Replaces each element with the cumulation of applying the given reducer to all previous values, and returns the total reduction. |
|
long |
precumulateSum()
Replaces each element with its prefix sum |
|
long |
reduce(Ops.LongReducer reducer,
long base)
Returns reduction of elements |
|
ParallelLongArray |
removeAll(Ops.LongPredicate selector)
Removes from the array all elements for which the given selector holds. |
|
ParallelLongArray |
removeConsecutiveDuplicates()
Removes consecutive elements that are equal, shifting others leftward, and possibly decreasing size. |
|
(package private) void |
removeSlotAt(int index)
|
|
(package private) void |
removeSlotsAt(int fromIndex,
int toIndex)
|
|
(package private) void |
replaceElementsParallelLongArrayWith(long[] a)
|
|
ParallelLongArray |
replaceWithGeneratedValue(Ops.LongGenerator generator)
Replaces elements with the results of applying the given generator. |
|
ParallelLongArray |
replaceWithMappedIndex(Ops.IntAndLongToLong op)
Replaces elements with the results of applying the given mapping to each index and current element value |
|
ParallelLongArray |
replaceWithMappedIndex(Ops.IntToLong op)
Replaces elements with the results of applying the given op to their indices. |
|
ParallelLongArray |
replaceWithMapping(Ops.BinaryLongOp combiner,
long[] other)
Replaces elements with results of applying op(thisElement, otherElement) |
|
ParallelLongArray |
replaceWithMapping(Ops.BinaryLongOp combiner,
ParallelLongArrayWithLongMapping other)
Replaces elements with results of applying op(thisElement, otherElement) |
|
ParallelLongArray |
replaceWithMapping(Ops.LongOp op)
Replaces elements with the results of applying the given op to their current values. |
|
ParallelLongArray |
replaceWithValue(long value)
Replaces elements with the given value. |
|
(package private) void |
resizeArray(int newCap)
|
|
(package private) int |
seqIndexOf(long target)
|
|
(package private) int |
seqLastIndexOf(long target)
|
|
void |
set(int i,
long x)
Sets the element of the array at the given index to the given value |
|
void |
setLimit(int newLimit)
Ensures that the underlying array can be accessed up to the given upper bound, reallocating and copying the underlying array to expand if necessary. |
|
int |
size()
Returns the effective size of the underlying array. |
|
ParallelLongArray |
sort()
Sorts the array, assuming all elements are Comparable. |
|
ParallelLongArray |
sort(Ops.LongComparator comparator)
Sorts the array. |
|
long |
sum()
Returns the sum of elements |
|
ParallelLongArray.SummaryStatistics |
summary()
Returns summary statistics, using natural comparator |
|
ParallelLongArray.SummaryStatistics |
summary(Ops.LongComparator comparator)
Returns summary statistics, using the given comparator to locate minimum and maximum elements. |
|
java.lang.String |
toString()
Equivalent to asList().toString() |
|
ParallelLongArrayWithBounds |
withBounds(int firstIndex,
int upperBound)
Returns an operation prefix that causes a method to operate only on the elements of the array between firstIndex (inclusive) and upperBound (exclusive). |
|
ParallelLongArrayWithFilter |
withFilter(Ops.BinaryLongPredicate selector,
ParallelLongArrayWithLongMapping other)
Returns an operation prefix that causes a method to operate only on elements for which the given binary selector returns true |
|
ParallelLongArrayWithFilter |
withFilter(Ops.LongPredicate selector)
Returns an operation prefix that causes a method to operate only on the elements of the array for which the given selector returns true |
|
ParallelLongArrayWithFilter |
withIndexedFilter(Ops.IntAndLongPredicate selector)
Returns an operation prefix that causes a method to operate only on elements for which the given indexed selector returns true |
|
ParallelLongArrayWithDoubleMapping |
withIndexedMapping(Ops.IntAndLongToDouble mapper)
Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value, and produces a new value. |
|
ParallelLongArrayWithLongMapping |
withIndexedMapping(Ops.IntAndLongToLong mapper)
Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value, and produces a new value. |
|
|
withIndexedMapping(Ops.IntAndLongToObject<? extends U> mapper)
Returns an operation prefix that causes a method to operate on mappings of this array using the given mapper that accepts as arguments an element's current index and value, and produces a new value. |
|
ParallelLongArrayWithLongMapping |
withMapping(Ops.BinaryLongOp combiner,
ParallelLongArrayWithLongMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array. |
|
ParallelLongArrayWithDoubleMapping |
withMapping(Ops.LongAndDoubleToDouble combiner,
ParallelDoubleArrayWithDoubleMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array. |
|
ParallelLongArrayWithLongMapping |
withMapping(Ops.LongAndDoubleToLong combiner,
ParallelDoubleArrayWithDoubleMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array. |
|
|
withMapping(Ops.LongAndDoubleToObject<? extends V> combiner,
ParallelDoubleArrayWithDoubleMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array. |
|
ParallelLongArrayWithDoubleMapping |
withMapping(Ops.LongAndLongToDouble combiner,
ParallelLongArrayWithLongMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array. |
|
|
withMapping(Ops.LongAndLongToObject<? extends V> combiner,
ParallelLongArrayWithLongMapping other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array. |
|
|
withMapping(Ops.LongAndObjectToDouble<? super V> combiner,
ParallelArrayWithMapping<W,V> other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array. |
|
|
withMapping(Ops.LongAndObjectToLong<? super V> combiner,
ParallelArrayWithMapping<W,V> other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array. |
|
|
withMapping(Ops.LongAndObjectToObject<? super V,? extends W> combiner,
ParallelArrayWithMapping<X,V> other)
Returns an operation prefix that causes a method to operate on binary mappings of this array and the other array. |
|
ParallelLongArrayWithLongMapping |
withMapping(Ops.LongOp op)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op. |
|
ParallelLongArrayWithDoubleMapping |
withMapping(Ops.LongToDouble op)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op. |
|
|
withMapping(Ops.LongToObject<? extends U> op)
Returns an operation prefix that causes a method to operate on mapped elements of the array using the given op. |
|
| Methods inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray.LUPap |
|---|
leafApply, leafBinaryIndexMap, leafCombineInPlace, leafCombineInPlace, leafFill, leafGenerate, leafIndexMap, leafReduce, leafTransform |
| Methods inherited from class groovyx.gpars.extra166y.ParallelLongArrayWithFilter |
|---|
leafTransfer, leafTransferByIndex, lget |
| Methods inherited from class groovyx.gpars.extra166y.ParallelLongArrayWithLongMapping |
|---|
sequentially |
| Methods inherited from class groovyx.gpars.extra166y.AbstractParallelAnyArray.LPap |
|---|
dget, leafMoveByIndex, leafMoveSelected, lgetArray, oget |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
ParallelLongArray.AsList listView
| Constructor Detail |
|---|
protected ParallelLongArray(jsr166y.ForkJoinPool executor,
long[] array,
int limit)
create(int, jsr166y.ForkJoinPool),
createEmpty(int, jsr166y.ForkJoinPool), createUsingHandoff(long[], jsr166y.ForkJoinPool) or createFromCopy(long[], jsr166y.ForkJoinPool).
executor - the executorarray - the arraylimit - the upper bound limit
ParallelLongArray(jsr166y.ForkJoinPool executor,
long[] array)
| Method Detail |
|---|
public static jsr166y.ForkJoinPool defaultExecutor()
public static ParallelLongArray create(int size,
jsr166y.ForkJoinPool executor)
size - the array sizeexecutor - the executor
public static ParallelLongArray createUsingHandoff(long[] handoff,
jsr166y.ForkJoinPool executor)
handoff - the arrayexecutor - the executor
public static ParallelLongArray createFromCopy(long[] source,
jsr166y.ForkJoinPool executor)
source - the source of initial elementsexecutor - the executor
public static ParallelLongArray createFromCopy(int size,
long[] source,
jsr166y.ForkJoinPool executor)
source - the source of initial elementssize - the array sizeexecutor - the executor
public static ParallelLongArray createEmpty(int size,
jsr166y.ForkJoinPool executor)
asList() operations.
size - the array sizeexecutor - the executorpublic jsr166y.ForkJoinPool getExecutor()
public void apply(Ops.LongProcedure procedure)
apply in class ParallelLongArrayWithLongMappingprocedure - the procedure
public long reduce(Ops.LongReducer reducer,
long base)
reduce in class ParallelLongArrayWithLongMappingreducer - the reducerbase - the result for an empty array
public ParallelLongArray all()
all in class ParallelLongArrayWithLongMappingpublic ParallelLongArray replaceWithMapping(Ops.LongOp op)
replaceWithMapping in class ParallelLongArrayWithFilterop - the op
public ParallelLongArray replaceWithMappedIndex(Ops.IntToLong op)
replaceWithMappedIndex in class ParallelLongArrayWithFilterop - the op
public ParallelLongArray replaceWithMappedIndex(Ops.IntAndLongToLong op)
replaceWithMappedIndex in class ParallelLongArrayWithFilterop - the op
public ParallelLongArray replaceWithGeneratedValue(Ops.LongGenerator generator)
replaceWithGeneratedValue in class ParallelLongArrayWithFiltergenerator - the generator
public ParallelLongArray replaceWithValue(long value)
replaceWithValue in class ParallelLongArrayWithFiltervalue - the value
public ParallelLongArray replaceWithMapping(Ops.BinaryLongOp combiner,
ParallelLongArrayWithLongMapping other)
replaceWithMapping in class ParallelLongArrayWithFilterother - the other arraycombiner - the combiner
public ParallelLongArray replaceWithMapping(Ops.BinaryLongOp combiner,
long[] other)
replaceWithMapping in class ParallelLongArrayWithFilterother - the other arraycombiner - the combiner
java.lang.ArrayIndexOutOfBoundsException - if other array has
fewer elements than this array.public int indexOf(long target)
indexOf in class AbstractParallelAnyArray.LUPaptarget - the element to search for
public int binarySearch(long target)
binarySearch in class AbstractParallelAnyArray.LUPaptarget - the element to search for
public int binarySearch(long target,
Ops.LongComparator comparator)
binarySearch in class AbstractParallelAnyArray.LUPaptarget - the element to search forcomparator - the comparator
public ParallelLongArray.SummaryStatistics summary(Ops.LongComparator comparator)
summary in class ParallelLongArrayWithLongMappingcomparator - the comparator to use for
locating minimum and maximum elements
public ParallelLongArray.SummaryStatistics summary()
summary in class ParallelLongArrayWithLongMappingpublic long min(Ops.LongComparator comparator)
min in class ParallelLongArrayWithLongMappingcomparator - the comparator
public long min()
min in class ParallelLongArrayWithLongMappingpublic long max(Ops.LongComparator comparator)
max in class ParallelLongArrayWithLongMappingcomparator - the comparator
public long max()
max in class ParallelLongArrayWithLongMapping
public ParallelLongArray cumulate(Ops.LongReducer reducer,
long base)
cumulate in class AbstractParallelAnyArray.LUPapreducer - the reducerbase - the result for an empty array
public long precumulate(Ops.LongReducer reducer,
long base)
precumulate in class AbstractParallelAnyArray.LUPapreducer - the reducerbase - the result for an empty array
public ParallelLongArray sort(Ops.LongComparator comparator)
sort in class AbstractParallelAnyArray.LUPapcomparator - the comparator to use
public ParallelLongArray sort()
sort in class AbstractParallelAnyArray.LUPapjava.lang.ClassCastException - if any element is not Comparable.public ParallelLongArray removeConsecutiveDuplicates()
public ParallelLongArray addAll(long[] other)
other - the elements to add
public ParallelLongArray addAll(ParallelLongArrayWithLongMapping other)
other - the elements to add
public ParallelLongArray allUniqueElements()
allUniqueElements in class ParallelLongArrayWithFilterpublic ParallelLongArray removeAll(Ops.LongPredicate selector)
selector - the selector
public boolean hasAllEqualElements(ParallelLongArrayWithLongMapping other)
hasAllEqualElements in class ParallelLongArrayWithFilterother - the other array
public long sum()
sum in class ParallelLongArrayWithLongMappingpublic ParallelLongArray cumulateSum()
cumulateSum in class AbstractParallelAnyArray.LUPappublic long precumulateSum()
precumulateSum in class AbstractParallelAnyArray.LUPap
public ParallelLongArrayWithBounds withBounds(int firstIndex,
int upperBound)
withBounds in class AbstractParallelAnyArray.LUPapfirstIndex - the lower bound (inclusive)upperBound - the upper bound (exclusive)
public ParallelLongArrayWithFilter withFilter(Ops.LongPredicate selector)
withFilter in class AbstractParallelAnyArray.LUPapselector - the selector
public ParallelLongArrayWithFilter withFilter(Ops.BinaryLongPredicate selector,
ParallelLongArrayWithLongMapping other)
withFilter in class ParallelLongArrayWithFilterselector - the selector
public ParallelLongArrayWithFilter withIndexedFilter(Ops.IntAndLongPredicate selector)
withIndexedFilter in class AbstractParallelAnyArray.LUPapselector - the selector
public <U> ParallelLongArrayWithMapping<U> withMapping(Ops.LongToObject<? extends U> op)
withMapping in class AbstractParallelAnyArray.LUPapop - the op
public ParallelLongArrayWithLongMapping withMapping(Ops.LongOp op)
withMapping in class AbstractParallelAnyArray.LUPapop - the op
public ParallelLongArrayWithDoubleMapping withMapping(Ops.LongToDouble op)
withMapping in class AbstractParallelAnyArray.LUPapop - the op
public <V,W,X> ParallelLongArrayWithMapping<W> withMapping(Ops.LongAndObjectToObject<? super V,? extends W> combiner,
ParallelArrayWithMapping<X,V> other)
withMapping in class ParallelLongArrayWithLongMappingcombiner - the combinerother - the other array
java.lang.IllegalArgumentException - if other array is a
filtered view (all filters must precede all mappings).
public <V> ParallelLongArrayWithMapping<V> withMapping(Ops.LongAndDoubleToObject<? extends V> combiner,
ParallelDoubleArrayWithDoubleMapping other)
withMapping in class ParallelLongArrayWithLongMappingcombiner - the combinerother - the other array
java.lang.IllegalArgumentException - if other array is a
filtered view (all filters must precede all mappings).
public <V> ParallelLongArrayWithMapping<V> withMapping(Ops.LongAndLongToObject<? extends V> combiner,
ParallelLongArrayWithLongMapping other)
withMapping in class ParallelLongArrayWithLongMappingcombiner - the combinerother - the other array
java.lang.IllegalArgumentException - if other array is a
filtered view (all filters must precede all mappings).
public <V,W> ParallelLongArrayWithDoubleMapping withMapping(Ops.LongAndObjectToDouble<? super V> combiner,
ParallelArrayWithMapping<W,V> other)
withMapping in class ParallelLongArrayWithLongMappingcombiner - the combinerother - the other array
java.lang.IllegalArgumentException - if other array is a
filtered view (all filters must precede all mappings).
public ParallelLongArrayWithDoubleMapping withMapping(Ops.LongAndDoubleToDouble combiner,
ParallelDoubleArrayWithDoubleMapping other)
withMapping in class ParallelLongArrayWithLongMappingcombiner - the combinerother - the other array
java.lang.IllegalArgumentException - if other array is a
filtered view (all filters must precede all mappings).
public ParallelLongArrayWithDoubleMapping withMapping(Ops.LongAndLongToDouble combiner,
ParallelLongArrayWithLongMapping other)
withMapping in class ParallelLongArrayWithLongMappingcombiner - the combinerother - the other array
java.lang.IllegalArgumentException - if other array is a
filtered view (all filters must precede all mappings).
public <V,W> ParallelLongArrayWithLongMapping withMapping(Ops.LongAndObjectToLong<? super V> combiner,
ParallelArrayWithMapping<W,V> other)
withMapping in class ParallelLongArrayWithLongMappingcombiner - the combinerother - the other array
java.lang.IllegalArgumentException - if other array is a
filtered view (all filters must precede all mappings).
public ParallelLongArrayWithLongMapping withMapping(Ops.LongAndDoubleToLong combiner,
ParallelDoubleArrayWithDoubleMapping other)
withMapping in class ParallelLongArrayWithLongMappingcombiner - the combinerother - the other array
java.lang.IllegalArgumentException - if other array is a
filtered view (all filters must precede all mappings).
public ParallelLongArrayWithLongMapping withMapping(Ops.BinaryLongOp combiner,
ParallelLongArrayWithLongMapping other)
withMapping in class ParallelLongArrayWithLongMappingcombiner - the combinerother - the other array
java.lang.IllegalArgumentException - if other array is a
filtered view (all filters must precede all mappings).public <U> ParallelLongArrayWithMapping<U> withIndexedMapping(Ops.IntAndLongToObject<? extends U> mapper)
withIndexedMapping in class AbstractParallelAnyArray.LUPapmapper - the mapper
public ParallelLongArrayWithDoubleMapping withIndexedMapping(Ops.IntAndLongToDouble mapper)
withIndexedMapping in class AbstractParallelAnyArray.LUPapmapper - the mapper
public ParallelLongArrayWithLongMapping withIndexedMapping(Ops.IntAndLongToLong mapper)
withIndexedMapping in class AbstractParallelAnyArray.LUPapmapper - the mapper
public java.util.Iterator<java.lang.Long> iterator()
asList().
public java.util.List<java.lang.Long> asList()
ArrayList, and may be used to modify, replace or extend the
bounds of the array underlying this ParallelLongArray. The methods
supported by this list view are not in general
implemented as parallel operations. This list is also not
itself thread-safe. In particular, performing list updates
while other parallel operations are in progress has undefined
(and surely undesired) effects.
public int size()
setLimit(int)), or the length of the array otherwise.
size in class AbstractParallelAnyArraypublic long[] getArray()
public long get(int i)
i - the index
public void set(int i,
long x)
i - the indexx - the valuepublic java.lang.String toString()
toString in class java.lang.Objectpublic final void setLimit(int newLimit)
newLimit - the new upper bound
java.lang.IllegalArgumentException - if newLimit less than zero.final void replaceElementsParallelLongArrayWith(long[] a)
final void resizeArray(int newCap)
final void insertElementAt(int index,
long e)
final void appendElement(long e)
final void insertSlotsAt(int index,
int len)
final void removeSlotAt(int index)
final void removeSlotsAt(int fromIndex,
int toIndex)
final int seqIndexOf(long target)
final int seqLastIndexOf(long target)
|
Copyright © 2008–2012 Václav Pech. All Rights Reserved. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||