|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovyx.gpars.extra166y.Ops
public class Ops
Interfaces and utilities declaring per-element operations used
within parallel methods on aggregates. This class provides type
names for all operation signatures accepting zero, one or two
arguments, and returning zero or one results, for parameterized
types, as well as specializations to int
, long
,
and double
. In keeping with normal Java evaluation rules
that promote, for example short
to int
, operation
names for these smaller types are absent.
Preliminary release note: Some of the declarations in this class are likely to be moved elsewhere in the JDK libraries upon actual release, and most likely will not all nested in the same class.
The naming conventions are as follows:
op
(short for "operate").
Op
(short for "operation") maps a single argument to
a result. Example: negating a value.
BinaryOp
maps two arguments to a result. Example:
dividing two numbers
Reducer
is an associative binary op
accepting and returning values of the same type; where op(a, op(b,
c)) should have the same result as op(op(a, b), c). Example:
adding two numbers.
Generator
takes no arguments and returns a result.
Examples: random number generators, builders
Procedure
accepts an argument but doesn't return a
result. Example: printing a value. An Action
is a
Procedure that takes no arguments.
Predicate
accepts a value and returns a boolean indicator
that the argument obeys some property. Example: testing if a number is even.
BinaryPredicate
accepts two values and returns a
boolean indicator that the arguments obeys some relation. Example:
testing if two numbers are relatively prime.
In addition to stated signatures, implementations of these interfaces must work safely in parallel. In general, this means methods should operate only on their arguments, and should not rely on ThreadLocals, unsafely published globals, or other unsafe constructions. Additionally, they should not block waiting for synchronization.
This class is normally best used via import static
.
Constructor Summary | |
private Ops()
|
Method Summary |
---|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
private Ops()
Copyright © 2008–2013 Václav Pech. All Rights Reserved.