|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.vector.Getter
public class Getter
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
getValue
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 | |
---|---|
Getter(java.lang.String prefix,
java.lang.String protocol,
java.lang.String methodn)
Constructs a Getter class based on the configuration. |
Method Summary | |
---|---|
java.lang.Number |
get(int i)
Gets the given value as a Number. |
java.lang.Number |
get(Node n)
Gets the given value as a Number. |
double |
getDouble(int i)
Gets the given real value. |
double |
getDouble(Node n)
Gets the given real value. |
long |
getLong(int i)
Gets the given integer value. |
long |
getLong(Node n)
Gets the given integer value. |
java.lang.Class |
getType()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Getter(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 getter method.
The parameter prefix + "." + protocol
is read.methodn
- the configuration parameter name that contains the getter
method name.
The parameter prefix + "." + methodn
is read, with the default
value getValue
.Method Detail |
---|
public java.lang.Class getType()
public java.lang.Number get(Node n)
n
- The node to get the value on. The protocol is defined
by pid
.
public long getLong(Node n)
n
- The node to get the value on. The protocol is defined
by pid
.
public double getDouble(Node n)
n
- The node to get the value on. The protocol is defined
by pid
.
public java.lang.Number get(int i)
i
- The index of the node to get the value on in the network.
The protocol is defined
by pid
.
public long getLong(int i)
i
- The index of the node to get the value on in the network.
The protocol is defined
by pid
.
public double getDouble(int i)
i
- The index of the node to get the value on in the network.
The protocol is defined
by pid
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |