# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.grid.executor.remote.akka.message

## Class Work<T>

• java.lang.Object
• com.numericalmethod.suanshu.grid.executor.remote.akka.message.Work<T>
• Type Parameters:
T - the type on which the work is performed

public final class Work<T>
extends Object
Represents a unit of work as done by an actor (worker). The work is defined as applying a generic Function to an argument.
• ### Constructor Summary

Constructors
Constructor and Description
Work(int index, Function<?,? super T> f, T data)
Creates an indexed work with the function and the input.
Work(int index, Function<?,? super T> f, T data, boolean useDeterministicAssignment)
Creates an indexed work with the function, the input, and .
• ### Method Summary

All Methods
Modifier and Type Method and Description
T data()
Function<?,? super T> f()
int index()
boolean useDeterministicAssignment()
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### Work

public Work(int index,
Function<?,? super T> f,
T data)
Creates an indexed work with the function and the input. By default, work is assigned to workers randomly (i.e., NOT using deterministic assignment).
Parameters:
index - the index of the operation, to be returned with the result
f - the function to be applied to the data
data - the data on which to apply the function
• #### Work

public Work(int index,
Function<?,? super T> f,
T data,
boolean useDeterministicAssignment)
Creates an indexed work with the function, the input, and .
Parameters:
index - the index of the operation, to be returned with the result
f - the function to be applied to the data
data - the data on which to apply the function
useDeterministicAssignment - whether the work should be assigned to workers deterministically, based on its index
• ### Method Detail

• #### f

public Function<?,? super T> f()
Returns:
the function
• #### data

public T data()
Returns:
the data
• #### index

public int index()
Returns:
the index of the operation
• #### useDeterministicAssignment

public boolean useDeterministicAssignment()
Returns:
whether the work should be assigned to workers deterministically