From b1354784633fb2bc9b50bbf876f92050094172f8 Mon Sep 17 00:00:00 2001 From: Supermjork Date: Wed, 1 Jun 2022 17:02:58 +0200 Subject: [PATCH] Created node to exist. --- .idea/vcs.xml | 2 +- src/RecipeNode.java | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7..35eb1dd 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/RecipeNode.java b/src/RecipeNode.java index 72d9b9a..9e3b9cf 100644 --- a/src/RecipeNode.java +++ b/src/RecipeNode.java @@ -1,3 +1,27 @@ -public class RecipeNode -{ +public class RecipeNode { + private String ingredient; // Ingredient's name + private double portion; // Portion size of ingredient + RecipeNode pointer; // To point at parent node + + // Accessors and Mutators for fields (Except pointer's) + RecipeNode(String ingredient, double portion) { + this.ingredient = ingredient; + this.portion = portion; + } + + public void setIngredient(String ingredient) { + this.ingredient = ingredient; + } + + public String getIngredient() { + return ingredient; + } + + public void setPortion(double portion) { + this.portion = portion; + } + + public double getPortion() { + return portion; + } }