|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.sahits.game.openpatrician.model.city.CityFactory
public class CityFactory
Factory class for the cities of the game.
| Field Summary | |
|---|---|
private static ConcurrentHashMap<String,ICity> |
createdCityCache
Cache storing the already created cities to avoid duplicate creation |
| Constructor Summary | |
|---|---|
CityFactory()
|
|
| Method Summary | |
|---|---|
static ICity |
createCityByName(ECityName cityName)
Create a standard city based on its unique identification |
static ICity |
createCityByName(String cityName)
Create a standard city based on its name |
private static ICity |
createIfNotStroed(ECityName name)
Retrieve the city from the cache or create the city and put it there. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static ConcurrentHashMap<String,ICity> createdCityCache
| Constructor Detail |
|---|
public CityFactory()
| Method Detail |
|---|
public static ICity createCityByName(String cityName)
throws IOException
cityName -
IOException - Error reading the city properties
public static ICity createCityByName(ECityName cityName)
throws IOException
cityName -
IOException - Error reading the city properties
private static ICity createIfNotStroed(ECityName name)
throws IOException
name - city name should not be null.
name is null
IOException - Error reading the city properties
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||