peersim.vector
Class VectCopy
java.lang.Object
peersim.vector.VectControl
peersim.vector.VectCopy
- All Implemented Interfaces:
- Control, NodeInitializer
public class VectCopy
- extends VectControl
- implements NodeInitializer
Sets values in a protocol vector by copying the values of another
protocol vector.
The source is defined by "source",
and getter method "getter".
This dynamics class can copy any primitive field in the source
protocol to any primitive field in the destination protocol,
provided that the former field is associated with a getter method,
while the latter is associated with a setter method.
- See Also:
VectControl
,
peersim.vector
Parameter Summary |
source
The identifier of the protocol to be copied. |
Constructor Summary |
VectCopy(java.lang.String prefix)
Standard constructor that reads the configuration parameters. |
Method Summary |
boolean |
execute()
Sets values in a protocol vector by copying the values of another
protocol vector. |
void |
initialize(Node n)
Sets the value by copying the value of another
protocol. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
source
- The identifier of the protocol to be copied.
The vector values are copied from this vector.
VectCopy
public VectCopy(java.lang.String prefix)
- Standard constructor that reads the configuration parameters.
Invoked by the simulation engine.
- Parameters:
prefix
- the configuration prefix for this class
execute
public boolean execute()
- Sets values in a protocol vector by copying the values of another
protocol vector. The source is defined by "source",
and getter method "getter".
Single nodes may avoid to be considered in the copy by throwing an
UnsupportedOperationException in the getter method; if so, the
setter method will not be invoked on the corresponding element
of the vector protocol.
- Specified by:
execute
in interface Control
- Returns:
- always false
initialize
public void initialize(Node n)
- Sets the value by copying the value of another
protocol. The source is defined by "source",
and getter method "getter".
- Specified by:
initialize
in interface NodeInitializer
- Parameters:
n
- the node to initialize