|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object peersim.config.FastConfig
public class FastConfig
Reads configuration regarding relations between protocols. Technically, this class is not necessary because protocols could access the configuration directly. However, it provides much faster access to "linkable" and "transport" information, enhancing runtime speed. This class is a static singleton and is initialized only when first accessed. During initialization it reads and caches the configuration info it handles.
Parameter Summary | |
---|---|
linkable
Parameter name in configuration that attaches a linkable protocol to a protocol. |
|
transport
Parameter name in configuration that attaches a transport layer protocol to a protocol. |
Field Summary | |
---|---|
protected static int[][] |
links
This array stores the protocol ids of the Linkable
protocols that are linked to the protocol given by the array index. |
protected static int[] |
transports
This array stores the protocol id of the Transport
protocol that is linked to the protocol given by the array index. |
Method Summary | |
---|---|
static int |
getLinkable(int pid)
Invokes getLinkable(pid, 0) . |
static int |
getLinkable(int pid,
int linkIndex)
Returns the protocol id of the linkIndex -th linkable used by
the protocol identified by pid. |
static int |
getTransport(int pid)
Returns the id of the transport protocol used by the protocol identified by pid. |
static boolean |
hasLinkable(int pid)
Returns true if the given protocol has at least one linkable protocol associated with it, otherwise false. |
static boolean |
hasTransport(int pid)
Returns true if the given protocol has a transport protocol associated with it, otherwise false. |
static int |
numLinkables(int pid)
Returns the number of linkable protocols associated with a given protocol. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Parameter Detail |
---|
linkable
transport
Field Detail |
---|
protected static final int[][] links
Linkable
protocols that are linked to the protocol given by the array index.
protected static final int[] transports
Transport
protocol that is linked to the protocol given by the array index.
Method Detail |
---|
public static boolean hasLinkable(int pid)
public static int numLinkables(int pid)
public static int getLinkable(int pid, int linkIndex)
linkIndex
-th linkable used by
the protocol identified by pid. Throws an
IllegalParameterException if there is no linkable associated with the given
protocol: we assume here that this happens when the configuration is
incorrect.
public static int getLinkable(int pid)
getLinkable(pid, 0)
.
public static boolean hasTransport(int pid)
public static int getTransport(int pid)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |