|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apfloat.samples.RemoteOperationExecutor
org.apfloat.samples.PiDistributed.Node
protected static class PiDistributed.Node
RemoteOperationExecutor that implements the weight property.
Constructor Summary | |
---|---|
PiDistributed.Node(String host,
int port,
int weight)
Construct a Node with the specified parameters and one processor. |
|
PiDistributed.Node(String host,
int port,
int weight,
int numberOfProcessors)
Construct a Node with the specified parameters. |
Method Summary | ||
---|---|---|
int |
compareTo(PiDistributed.Node that)
Compare this Node to another Node. |
|
|
execute(Operation<T> operation)
Execute an operation remotely. |
|
|
executeBackground(Operation<T> operation)
Execute an operation remotely. |
|
int |
getNumberOfProcessors()
Get the number of processors. |
|
int |
getWeight()
Returns the relative weight of this executor. |
|
void |
setNumberOfProcessors(int numberOfProcessors)
Set the number of processors. |
|
void |
setWeight(int weight)
Set the weight. |
|
String |
toString()
Convert to String. |
Methods inherited from class org.apfloat.samples.RemoteOperationExecutor |
---|
getHost, getPort |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PiDistributed.Node(String host, int port, int weight)
host
- The remote host.port
- The remote port.weight
- The weight.public PiDistributed.Node(String host, int port, int weight, int numberOfProcessors)
host
- The remote host.port
- The remote port.weight
- The weight.numberOfProcessors
- The number of processors.Method Detail |
---|
public <T> T execute(Operation<T> operation)
RemoteOperationExecutor
execute
in interface OperationExecutor
execute
in class RemoteOperationExecutor
operation
- The operation to execute remotely.
public <T> BackgroundOperation<T> executeBackground(Operation<T> operation)
RemoteOperationExecutor
executeBackground
in interface OperationExecutor
executeBackground
in class RemoteOperationExecutor
operation
- The operation to execute remotely.
BackgroundOperation
for retrieving the result of the operation later.public void setWeight(int weight)
weight
- The weight.public int getWeight()
OperationExecutor
getWeight
in interface OperationExecutor
getWeight
in class RemoteOperationExecutor
public void setNumberOfProcessors(int numberOfProcessors)
numberOfProcessors
- The number of processors.public int getNumberOfProcessors()
public int compareTo(PiDistributed.Node that)
compareTo
in interface Comparable<PiDistributed.Node>
that
- The other node to compare to.
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |