superpeer
Class RandomSpp

java.lang.Object
  extended by superpeer.RandomSpp
All Implemented Interfaces:
java.lang.Cloneable, peersim.cdsim.CDProtocol, peersim.core.Protocol, peersim.vector.SingleValue, Superpeer

public class RandomSpp
extends java.lang.Object
implements peersim.cdsim.CDProtocol, Superpeer, peersim.vector.SingleValue


Field Summary
static java.lang.String PAR_ATTEMPTS
          String name of the parameter
static java.lang.String PAR_RATIO
          String name of the parameter
static java.lang.String PAR_SUPERPEER
          String name of the parameter
 
Constructor Summary
RandomSpp(java.lang.String prefix)
           
 
Method Summary
 java.lang.Object clone()
          Just clones the object by calling super's clone() method.
 int degree()
           
 int getCapacity()
           
 peersim.core.Node getClient(int j)
           
 peersim.core.Node getSuperpeer()
           
 int getTarget()
           
 double getValue()
           
 boolean isSuperpeer()
           
 void nextCycle(peersim.core.Node node, int pid)
           
 double ratio()
           
 void setCapacity(int capacity)
           
 void setValue(double capacity)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAR_SUPERPEER

public static final java.lang.String PAR_SUPERPEER
String name of the parameter

See Also:
Constant Field Values

PAR_ATTEMPTS

public static final java.lang.String PAR_ATTEMPTS
String name of the parameter

See Also:
Constant Field Values

PAR_RATIO

public static final java.lang.String PAR_RATIO
String name of the parameter

See Also:
Constant Field Values
Constructor Detail

RandomSpp

public RandomSpp(java.lang.String prefix)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Just clones the object by calling super's clone() method.

Specified by:
clone in interface peersim.core.Protocol
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

nextCycle

public void nextCycle(peersim.core.Node node,
                      int pid)
Specified by:
nextCycle in interface peersim.cdsim.CDProtocol

isSuperpeer

public boolean isSuperpeer()
Specified by:
isSuperpeer in interface Superpeer

getSuperpeer

public peersim.core.Node getSuperpeer()
Specified by:
getSuperpeer in interface Superpeer

getClient

public peersim.core.Node getClient(int j)
Specified by:
getClient in interface Superpeer

degree

public int degree()
Specified by:
degree in interface Superpeer

setValue

public void setValue(double capacity)
Specified by:
setValue in interface peersim.vector.SingleValue

getValue

public double getValue()
Specified by:
getValue in interface peersim.vector.SingleValue

setCapacity

public void setCapacity(int capacity)
Specified by:
setCapacity in interface Superpeer

getCapacity

public int getCapacity()
Specified by:
getCapacity in interface Superpeer

getTarget

public int getTarget()
Specified by:
getTarget in interface Superpeer

ratio

public double ratio()