Datasets:
ArXiv:
License:
Download data/train/SeanDecker1/DietManagerJava/src/model/BasicFood.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/SeanDecker1/DietManagerJava/src/model/BasicFood.java
- Command line
-
hf download hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/SeanDecker1/DietManagerJava/src/model/BasicFood.java
-
curl -L -o BasicFood.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/SeanDecker1/DietManagerJava/src/model/BasicFood.java
1.2 kB
| package model; | |
| import java.util.List; | |
| public class BasicFood extends Food { | |
| public BasicFood(String name) { | |
| super(name); | |
| this.calories = 0; | |
| this.protein = 0; | |
| this.carbs = 0; | |
| this.fat = 0; | |
| this.serving = serving; | |
| } | |
| public BasicFood(String name, int calories, double fats, double carbs, double protein) { | |
| super(name); | |
| this.calories = calories; | |
| this.protein = protein; | |
| this.carbs = carbs; | |
| this.fat = fats; | |
| this.serving = 1; | |
| } | |
| public List<Food> getChildren() { | |
| return null; | |
| } | |
| public Food getChild(int index) { | |
| return null; | |
| } | |
| public void addChild(Food food, String serving) { } | |
| public void removeChild(Food foodToRemove) { } | |
| public String buildCSVFormat() { | |
| return "b," + name + "," + calories + "," + fat + "," + carbs + "," + protein; | |
| } | |
| public Food copy() { | |
| BasicFood copyFood = new BasicFood(name, calories, fat, carbs, protein); | |
| copyFood.serving = serving; | |
| return copyFood; | |
| } | |
| } // end of BasicFood Class | |