Overview

The following data comes from the United States Department of Agriculture's Food Composition Database. It contains data for various types of food including the amounts of different vitamins and minerals found in the foods as well as macronutrient percentages. The food covered spans a large variety of foods from butter to Campbell's soup. Much of the supplementary documenation for each field comes directly from that pages' Wikipedia article.

https://ndb.nal.usda.gov/

Downloads

Download all of the following files.

Usage

Begin by adding the above JAR file to your classpath. This library has 1 function you can use.
import corgis.food.FoodLibrary;
import corgis.food.domain.*;
import java.util.ArrayList;

public class ExampleClass {
    public static void main(String[] args) {
        // Get access to the library
        FoodLibrary foodLibrary = new FoodLibrary();
        // Access data inside the library
        ArrayList<Report> list_of_report = foodLibrary.getReports(false);
    }
}
Additionally, some of the functions can optionally return Big Data using the last argument (setting it to true). If you use this Big Data, it may be much slower. Wait until you are sure your code is correct before using these examples.
import corgis.food.FoodLibrary;
import corgis.food.domain.*;
import java.util.ArrayList;

public class ExampleClass {
    public static void main(String[] args) {
        // Get access to the library
        FoodLibrary foodLibrary = new FoodLibrary();
        // Access data inside the library
        ArrayList<Report> list_of_report = foodLibrary.getReports(true);
    }
}

Documentation

We provide full JavaDoc for this library. Alternatively, you may refer to the below:

 foodLibrary.getReports(test)

Returns food reports from the dataset.