|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.vector.Setter
public class Setter
Vectors can be written through this class. Typically Control
classes
use this to manipulate vectors.
The method to be used is specified at construction time.
For backward compatibility, if no method is specified, the method
setValue
is used. In this way, protocols
implementing the SingleValue
interface can be manipulated using the
old configuration syntax (i.e., without specifying the method).
Please refer to package peersim.vector
for a detailed description of
the concept of protocol vector and the role of getters and setters.
Constructor Summary | |
---|---|
Setter(java.lang.String prefix,
java.lang.String protocol,
java.lang.String methodn)
Constructs a Setter class based on the configuration. |
Method Summary | |
---|---|
java.lang.Class |
getType()
|
boolean |
isInteger()
|
void |
set(int i,
double val)
Sets the given real value. |
void |
set(int i,
long val)
Sets the given integer value. |
void |
set(Node n,
double val)
Sets the given real value. |
void |
set(Node n,
long val)
Sets the given integer value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Setter(java.lang.String prefix, java.lang.String protocol, java.lang.String methodn)
prefix
- the configuration prefix to use when reading the configurationprotocol
- the configuration parameter name that contains
the protocol we want to manipulate using a setter method.
The parameter prefix + "." + protocol
is read.methodn
- the configuration parameter name that contains the setter
method name.
The parameter prefix + "." + methodn
is read, with the default
value setValue
.Method Detail |
---|
public java.lang.Class getType()
public boolean isInteger()
public void set(Node n, long val)
n
- The node to set the value on. The protocol is defined
by pid
.val
- the value to set.public void set(Node n, double val)
n
- The node to set the value on. The protocol is defined
by pid
.val
- the value to set.public void set(int i, long val)
i
- The index of the node to set the value on in the network.
The protocol is defined
by pid
.val
- the value to set.public void set(int i, double val)
i
- The index of the node to set the value on in the network.
The protocol is defined
by pid
.val
- the value to set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |