public static Building factory(String buildingName, String path) {
    Log.d(TAG, "building factory: " + buildingName + ", " + path);
    Building retval = null;
    retval = Building.fromXml(path + "/" + buildingName + ".xml");
    if (retval == null) retval = new EmptyBuilding();

    retval.optimize();
    return retval;
  }
 private static Building loadFromXmlAndCache(String name, File cache) {
   Building retval = Building.fromXml(name);
   retval.areaChanged(1);
   retval.optimize();
   try {
     Building.saveToCache(retval, cache);
   } catch (IOException e) {
     Log.e(TAG, "failed to save building to cache");
     e.printStackTrace();
   }
   return retval;
 }