|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--anthill.antsim.impl.PeernetImpl
This is a basic implementation of the Peernet interface. A PeernetImpl
is characterized by a certain size (i.e., the number of nests composing
it) and a degree (i.e., the number of links connecting it to other
nests).
This Peernet
implementation uses the Factory
class to
dynamically instantiate objects implementing Nest; the Factory
instance must be opportunely instructed with an XML definition for Nest
.
Field Summary | |
protected int |
degree
The degree of the nests, i.e. the number of links to other nests |
protected Factory |
factory
Reference to the peernet factory which created this object |
protected Nest[] |
nests
Nest network |
protected int |
nestVersion
Nest version |
protected int |
size
The size of the network, i.e. the number of nests included in it |
Constructor Summary | |
PeernetImpl(Factory factory,
int size,
int degree)
Initialize a new Peernet factory |
Method Summary | |
void |
clear()
Restores the object to its initial state. |
Nest[] |
getNests()
Return the nodes composing the simulated p2p network |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Factory factory
protected int size
protected int degree
protected Nest[] nests
protected int nestVersion
Constructor Detail |
public PeernetImpl(Factory factory, int size, int degree)
factory
- the factory to be utilizedMethod Detail |
public Nest[] getNests()
getNests
in interface Peernet
public void clear()
clear
in interface Clearable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |