RecipeAcceptor.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:craftinomicon 作者:
public static <T> T accept(Recipe recipe, RecipeVisitor<T> visitor) {
    if (recipe instanceof ShapedRecipe) {
        ShapedRecipe shapedRecipe = (ShapedRecipe) recipe;
        return visitor.visit(shapedRecipe);
    } else if (recipe instanceof ShapelessRecipe) {
        ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;
        return visitor.visit(shapelessRecipe);
    } else if (recipe instanceof FurnaceRecipe) {
        FurnaceRecipe furnaceRecipe = (FurnaceRecipe) recipe;
        return visitor.visit(furnaceRecipe);
    }
    return visitor.visitOther(recipe);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号