public void addComponent(ModifiableComponent comp) { if (comp instanceof SocietyComponent) addSocietyComponent((SocietyComponent)comp); else if (comp instanceof RecipeComponent) addRecipe((RecipeComponent)comp);
public void addComponent(ModifiableComponent comp) throws IllegalArgumentException { if (comp instanceof SocietyComponent) { try { addSocietyComponent((SocietyComponent)comp); } catch (IllegalArgumentException e) { if(log.isErrorEnabled()) { log.error("SocietyComponent already set"); } } } else if (comp instanceof RecipeComponent) { addRecipeComponent((RecipeComponent)comp); } else { throw new IllegalArgumentException("Unsupported Component Type" + this); }
  public void addComponent(ModifiableComponent comp) {    if (comp instanceof SocietyComponent)      addSocietyComponent((SocietyComponent)comp);    else if (comp instanceof RecipeComponent)      addRecipe((RecipeComponent)comp);  }