Added nothing in fact...
This commit is contained in:
parent
4193fdade4
commit
43eb9a2464
@ -1,4 +1,28 @@
|
||||
package cz.cvut.fel.sit.omo.foodchain.factory;
|
||||
|
||||
public class ChannelFactory {
|
||||
|
||||
import cz.cvut.fel.sit.omo.foodchain.channel.*;
|
||||
|
||||
public class ChannelFactory
|
||||
{
|
||||
public enum ChannelType
|
||||
{
|
||||
Fruit, Vegetable, Meat, Other;
|
||||
}
|
||||
|
||||
public ChannelBase makeChannel(ChannelType typeOfChannel)
|
||||
{
|
||||
switch (typeOfChannel)
|
||||
{
|
||||
case Fruit:
|
||||
return new FruitChannel();
|
||||
case Vegetable:
|
||||
return new VegetableChannel();
|
||||
case Meat:
|
||||
return new MeatChannel();
|
||||
case Other:
|
||||
return new OtherChannel();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,48 +5,68 @@ import cz.cvut.fel.sit.omo.foodchain.util.Singleton;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class FactoryManager {
|
||||
//todo
|
||||
public NodeFactory getNodeFactoryInstance() {
|
||||
try {
|
||||
public class FactoryManager
|
||||
{
|
||||
public NodeFactory getNodeFactoryInstance()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Singleton.getInstance(NodeFactory.class);
|
||||
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
|
||||
}
|
||||
catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ChannelFactory getChannelFactoryInstance() {
|
||||
try {
|
||||
public ChannelFactory getChannelFactoryInstance()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Singleton.getInstance(ChannelFactory.class);
|
||||
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
|
||||
}
|
||||
catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ScenarioFactory getScenarioFactoryInstance() {
|
||||
try {
|
||||
public ScenarioFactory getScenarioFactoryInstance()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Singleton.getInstance(ScenarioFactory.class);
|
||||
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
|
||||
}
|
||||
catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ProductFactory getProductFactoryInstance() {
|
||||
try {
|
||||
public ProductFactory getProductFactoryInstance()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Singleton.getInstance(ProductFactory.class);
|
||||
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
|
||||
}
|
||||
catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public PoolDatabase getPoolDatabaseInstance() {
|
||||
try {
|
||||
public PoolDatabase getPoolDatabaseInstance()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Singleton.getInstance(PoolDatabase.class);
|
||||
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
|
||||
}
|
||||
catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
package cz.cvut.fel.sit.omo.foodchain.factory;
|
||||
|
||||
public class NodeFactory {
|
||||
public class NodeFactory
|
||||
{
|
||||
//make
|
||||
}
|
||||
|
||||
@ -1,4 +1,12 @@
|
||||
package cz.cvut.fel.sit.omo.foodchain.factory;
|
||||
|
||||
public class ProductFactory {
|
||||
import cz.cvut.fel.sit.omo.foodchain.product.Product;
|
||||
import cz.cvut.fel.sit.omo.foodchain.product.ProductType;
|
||||
|
||||
public class ProductFactory
|
||||
{
|
||||
public Product makeProduct(String name, ProductType productType)
|
||||
{
|
||||
return new Product(name, productType);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
package cz.cvut.fel.sit.omo.foodchain.factory;
|
||||
|
||||
public class ScenarioFactory {
|
||||
public class ScenarioFactory
|
||||
{
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user