|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.generic.commonapi.factory.NetworkFactoryImpl
This factory abstracts a NetworkFactory. The file passed by parameter at constructor must contains:
Network
Field Summary | |
protected int |
bitsKey
Number of bits for the Ids of Nodes. |
protected java.lang.reflect.Constructor |
networkConstructor
The Constructor for Networks. |
protected int |
networkSize
The default network size to use for build a network. |
protected NodeFactory |
nodeFactory
The NodeFactory actually in use. |
protected java.lang.String |
serializedFile
The default filename from where read a serialized state of a network. |
protected java.lang.String |
topology
The default topology to use for build a network. |
Constructor Summary | |
NetworkFactoryImpl(java.lang.Class networkClass,
java.lang.Class nodeFactClass,
java.lang.Class idFactory,
java.lang.Class nodeClass,
java.lang.Class idClass,
java.lang.String topology,
int networkSize)
Builds a new instance of the NetworkFactory using all specified parameters. |
|
NetworkFactoryImpl(java.lang.String propertiesFile)
Builds a new instance of NetworkFactory reading all necessary properties from propertiesFile. |
Method Summary | |
Network |
buildNetwork()
Builds a network with the actual specified properties. |
Network |
buildNetwork(int size)
Builds a network with the actual specified properties, but overwriting the number of nodes to build within. |
Network |
buildNetwork(int size,
NodeFactory nodeFactory)
Builds a new network with the specified size and this concrete nodeFactory. |
Network |
buildNetwork(int size,
NodeFactory nodeFactory,
java.lang.String topology)
Builds a new network with the specified size, this concrete nodeFactory and network topology. |
Network |
buildNetwork(int size,
NodeFactory nodeFactory,
java.lang.String topology,
int k)
Builds a new network with the specified size, this concrete nodeFactory, network topology and k bits to construct new Ids for the Nodes. |
Network |
buildNetwork(int size,
java.lang.String topology)
Builds a network with the specified size for the network, building it under this concrete topology. |
int |
getNetworkSize()
Inform from the network size for the default building networks. |
NodeFactory |
getNodeFactory()
Returns the NodeFactory actually in use. |
java.lang.String |
getSerializedFile()
Gets the filename for the serialized state of some network. |
java.lang.String |
getTopology()
Inform the topology actually in use to build networks. |
void |
setNetworkSize(int size)
Sets a new size for the default building networks. |
void |
setNodeFactory(NodeFactory nodeFactory)
Sets the NodeFactory to use in the future. |
void |
setSerializedFile(java.lang.String file)
Sets the filename for capture a serialized state of some network. |
void |
setTopology(java.lang.String topology)
Sets the topology for the networks to build in the future. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.reflect.Constructor networkConstructor
protected NodeFactory nodeFactory
protected int networkSize
protected int bitsKey
protected java.lang.String topology
protected java.lang.String serializedFile
Constructor Detail |
public NetworkFactoryImpl(java.lang.String propertiesFile) throws InitializationException
propertiesFile
- File of properties which contains all properties of factories.
InitializationException
- if occur any problem during initialization.public NetworkFactoryImpl(java.lang.Class networkClass, java.lang.Class nodeFactClass, java.lang.Class idFactory, java.lang.Class nodeClass, java.lang.Class idClass, java.lang.String topology, int networkSize) throws InitializationException
nodeFactClass
- NodeFactory class to use to build new nodes.idFactory
- IdFactory class to use to build new Ids.nodeClass
- Node class to use to build new nodes.idClass
- Id class to use to build new Ids.networkSize
- Size of the target network to build.topology
- Topology of the target network to build.
InitializationException
- if occurs any problem during initialization.Method Detail |
public Network buildNetwork() throws InitializationException
buildNetwork
in interface NetworkFactory
InitializationException
- if occurs any problem during
the process to build the network.NetworkFactory.buildNetwork()
public Network buildNetwork(int size) throws InitializationException
buildNetwork
in interface NetworkFactory
size
- The number of Nodes for the new Network
InitializationException
- if occurs any problem during
the process to build the network.planet.commonapi.factory.NetworkFactory#buildNetwork(long)
public Network buildNetwork(int size, java.lang.String topology) throws InitializationException
buildNetwork
in interface NetworkFactory
size
- The number of Nodes for the new Networktopology
- The network topology to constructs new network.
InitializationException
- if occurs any problem during
the process to build the network.planet.commonapi.factory.NetworkFactory#buildNetwork(long, java.lang.String)
public Network buildNetwork(int size, NodeFactory nodeFactory) throws InitializationException
buildNetwork
in interface NetworkFactory
size
- The number of Nodes for the new NetworknodeFactory
- The NodeFactory to use to build Nodes for the new network.
InitializationException
- if occurs any problem during
the process to build the network.planet.commonapi.factory.NetworkFactory#buildNetwork(long, planet.commonapi.node.NodeFactory)
public Network buildNetwork(int size, NodeFactory nodeFactory, java.lang.String topology) throws InitializationException
buildNetwork
in interface NetworkFactory
size
- The number of Nodes for the new NetworknodeFactory
- The NodeFactory to use to build Nodes for the new network.topology
- The network topology to constructs new network.
InitializationException
- if occurs any problem during
the process to build the network.planet.commonapi.factory.NetworkFactory#buildNetwork(long, planet.commonapi.node.NodeFactory, java.lang.String)
public Network buildNetwork(int size, NodeFactory nodeFactory, java.lang.String topology, int k) throws InitializationException
buildNetwork
in interface NetworkFactory
size
- The number of Nodes for the new NetworknodeFactory
- The NodeFactory to use to build Nodes for the new network.topology
- The network topology to constructs new network.k
- The number of bits for the NodeImpl's Ids.
InitializationException
- if occurs any problem during
the process to build the network.planet.commonapi.factory.NetworkFactory#buildNetwork(int, planet.commonapi.node.NodeFactory, java.lang.String, int)
public NodeFactory getNodeFactory()
getNodeFactory
in interface NetworkFactory
NetworkFactory.getNodeFactory()
public void setNodeFactory(NodeFactory nodeFactory)
setNodeFactory
in interface NetworkFactory
nodeFactory
- NodeFactory to use in the future.planet.commonapi.factory.NetworkFactory#setNodeFactory(planet.commonapi.node.NodeFactory)
public int getNetworkSize()
getNetworkSize
in interface NetworkFactory
NetworkFactory.getNetworkSize()
public void setNetworkSize(int size)
setNetworkSize
in interface NetworkFactory
size
- The new size for the default building networks.planet.commonapi.factory.NetworkFactory#setNetworkSize(long)
public java.lang.String getTopology()
getTopology
in interface NetworkFactory
NetworkFactory.getTopology()
public void setTopology(java.lang.String topology) throws InitializationException
setTopology
in interface NetworkFactory
topology
- The new topology for the default building networks.
InitializationException
- if the topology is not suported.NetworkFactory.setTopology(java.lang.String)
public java.lang.String getSerializedFile()
getSerializedFile
in interface NetworkFactory
NetworkFactory.getSerializedFile()
public void setSerializedFile(java.lang.String file) throws InitializationException
setSerializedFile
in interface NetworkFactory
file
- Filename from where read the serialized state of a network.
InitializationException
- if occur some problem with that fileNetworkFactory.setSerializedFile(java.lang.String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |