peersim.vector
Class SingleValueHolder

java.lang.Object
  extended by peersim.vector.SingleValueHolder
All Implemented Interfaces:
java.lang.Cloneable, Protocol, SingleValue
Direct Known Subclasses:
AverageED, AverageFunction, BasicBalance, TestVectors

public class SingleValueHolder
extends java.lang.Object
implements SingleValue, Protocol

The task of this protocol is to store a single double value and make it available through the SingleValue interface.


Field Summary
protected  double value
          Value held by this protocol
 
Constructor Summary
SingleValueHolder(java.lang.String prefix)
          Does nothing.
 
Method Summary
 java.lang.Object clone()
          Clones the value holder.
 double getValue()
          Returns the value of the parameter hold by the implementor of this interface.
 void setValue(double value)
          Modifies the value of the parameter hold by the implementor of this interface.
 java.lang.String toString()
          Returns the value as a string.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected double value
Value held by this protocol

Constructor Detail

SingleValueHolder

public SingleValueHolder(java.lang.String prefix)
Does nothing.

Method Detail

clone

public java.lang.Object clone()
Clones the value holder.

Specified by:
clone in interface Protocol
Overrides:
clone in class java.lang.Object

getValue

public double getValue()
Description copied from interface: SingleValue
Returns the value of the parameter hold by the implementor of this interface.

Specified by:
getValue in interface SingleValue

setValue

public void setValue(double value)
Description copied from interface: SingleValue
Modifies the value of the parameter hold by the implementor of this interface.

Specified by:
setValue in interface SingleValue

toString

public java.lang.String toString()
Returns the value as a string.

Overrides:
toString in class java.lang.Object