|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NodeBehavior
NodeBehavior class provides an interface for the different node behaviors such as allowing to forward and receive packets and also contains information about the debts and confidence of nodes. It allows implementation of a freeloader or a freeloader behavior for different behavior types such AncestorRatingBehavior and DebtMaintenanceBehavior
Method Summary | |
---|---|
boolean |
allowChild(Node myNode,
Node candidateChild)
Asks the node behavior if the given Node is allowed to be a child of the Node this behavior is for. |
boolean |
allowForward(Node myNode,
Node target)
Returns true if this node behavior is currently allowing the Node to send to the given target. |
java.lang.Double |
getConfidence(Node n)
Returns this behavior's confidence of the given Node, or null if there is no opinion. |
java.lang.Double |
getDebtLevel(Node n)
Returns this behavior's debt level measurement of the given Node, or null if there is no opinion. |
boolean |
hasConfidenceInformation()
Returns true if this behavior has confidence information on any Node |
boolean |
hasDebtLevelInformation()
Returns true if this behavior has debt levels for any Node |
void |
receivedPacket(Node myNode,
NodePacket packet)
Event to the node behavior for when a packet is received by the Node. |
void |
sentPacket(Node myNode,
Node destination,
NodePacket packet)
Event called when a Node sends a packet to a child. |
void |
setParameter(java.lang.String param)
Allows setting of a single behavior-specific parameter. |
Method Detail |
---|
void setParameter(java.lang.String param)
param
- non-null Stringboolean allowChild(Node myNode, Node candidateChild)
myNode
- non-null Node to which this behavior belongs.candidateChild
- non-null Node that is not equal to myNode.
boolean allowForward(Node myNode, Node target)
myNode
- non-null Node to which this behavior belongs.target
- non-null Node that is not equal to myNode.void receivedPacket(Node myNode, NodePacket packet)
myNode
- non-null Node to which this behavior belongs.packet
- non-null NodePacket destined for this behavior's Node.void sentPacket(Node myNode, Node destination, NodePacket packet)
myNode
- non-null Node to which this behavior belongs.destination
- non-null Node where the packet is going.packet
- non-null NodePacket destined for this behavior's Node.boolean hasConfidenceInformation()
boolean hasDebtLevelInformation()
java.lang.Double getConfidence(Node n)
n
- non-null Node to get information about
java.lang.Double getDebtLevel(Node n)
n
- non-null Node to get information about
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |