1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
package ca.spaz.cron.datasource.sql.USDAsr17; |
13 |
|
|
14 |
|
import java.util.HashMap; |
15 |
|
|
16 |
|
public class USDANutrientInfo { |
17 |
|
|
18 |
|
private static HashMap nutrientMap; |
19 |
|
|
20 |
0 |
public USDANutrientInfo() {} |
21 |
|
|
22 |
|
public String table; |
23 |
|
|
24 |
|
public String tag; |
25 |
|
|
26 |
|
private static void makeNutrientMap() { |
27 |
0 |
addNutrient("AminoAcids", "TRP", "501"); |
28 |
0 |
addNutrient("AminoAcids", "THR", "502"); |
29 |
0 |
addNutrient("AminoAcids", "ILE", "503"); |
30 |
0 |
addNutrient("AminoAcids", "LEU", "504"); |
31 |
0 |
addNutrient("AminoAcids", "LYS", "505"); |
32 |
0 |
addNutrient("AminoAcids", "MET", "506"); |
33 |
0 |
addNutrient("AminoAcids", "CYS", "507"); |
34 |
0 |
addNutrient("AminoAcids", "PHE", "508"); |
35 |
0 |
addNutrient("AminoAcids", "TYR", "509"); |
36 |
0 |
addNutrient("AminoAcids", "VAL", "510"); |
37 |
0 |
addNutrient("AminoAcids", "ARG", "511"); |
38 |
0 |
addNutrient("AminoAcids", "HIS", "512"); |
39 |
0 |
addNutrient("AminoAcids", "ALA", "513"); |
40 |
0 |
addNutrient("AminoAcids", "ASP", "514"); |
41 |
0 |
addNutrient("AminoAcids", "GLU", "515"); |
42 |
0 |
addNutrient("AminoAcids", "GLY", "516"); |
43 |
0 |
addNutrient("AminoAcids", "PRO", "517"); |
44 |
0 |
addNutrient("AminoAcids", "SER", "518"); |
45 |
0 |
addNutrient("AminoAcids", "HYP", "521"); |
46 |
|
|
47 |
0 |
addNutrient("Minerals", "calcium", "301"); |
48 |
0 |
addNutrient("Minerals", "copper", "312"); |
49 |
0 |
addNutrient("Minerals", "iron", "303"); |
50 |
0 |
addNutrient("Minerals", "magnesium", "304"); |
51 |
0 |
addNutrient("Minerals", "manganese", "315"); |
52 |
0 |
addNutrient("Minerals", "phosphorus", "305"); |
53 |
0 |
addNutrient("Minerals", "potassium", "306"); |
54 |
0 |
addNutrient("Minerals", "selenium", "317"); |
55 |
0 |
addNutrient("Minerals", "sodium", "307"); |
56 |
0 |
addNutrient("Minerals", "zinc", "309"); |
57 |
|
|
58 |
0 |
addNutrient("MacroNutrients", "kcals", "208"); |
59 |
0 |
addNutrient("MacroNutrients", "protein", "203"); |
60 |
0 |
addNutrient("MacroNutrients", "lipid", "204"); |
61 |
0 |
addNutrient("MacroNutrients", "carbs", "205"); |
62 |
0 |
addNutrient("MacroNutrients", "ash", "207"); |
63 |
0 |
addNutrient("MacroNutrients", "starch", "209"); |
64 |
0 |
addNutrient("MacroNutrients", "water", "255"); |
65 |
0 |
addNutrient("MacroNutrients", "kj", "268"); |
66 |
0 |
addNutrient("MacroNutrients", "sugar", "269"); |
67 |
0 |
addNutrient("MacroNutrients", "fiber", "291"); |
68 |
|
|
69 |
0 |
addNutrient("Vitamins", "vit_a", "318"); |
70 |
0 |
addNutrient("Vitamins", "retinol", "319"); |
71 |
0 |
addNutrient("Vitamins", "alpha_carotene", "322"); |
72 |
0 |
addNutrient("Vitamins", "beta_carotene", "321"); |
73 |
0 |
addNutrient("Vitamins", "beta_cryptoxanthin", "334"); |
74 |
0 |
addNutrient("Vitamins", "lycopene", "337"); |
75 |
0 |
addNutrient("Vitamins", "lutein", "338"); |
76 |
0 |
addNutrient("Vitamins", "vit_b6", "415"); |
77 |
0 |
addNutrient("Vitamins", "vit_b12", "418"); |
78 |
0 |
addNutrient("Vitamins", "vit_c", "401"); |
79 |
0 |
addNutrient("Vitamins", "vit_d", "324"); |
80 |
0 |
addNutrient("Vitamins", "vit_e", "323"); |
81 |
0 |
addNutrient("Vitamins", "beta_tocopherol", "341"); |
82 |
0 |
addNutrient("Vitamins", "delta_tocopherol", "343"); |
83 |
0 |
addNutrient("Vitamins", "gamma_tocopherol", "342"); |
84 |
0 |
addNutrient("Vitamins", "vit_k", "430"); |
85 |
0 |
addNutrient("Vitamins", "thiamin", "404"); |
86 |
0 |
addNutrient("Vitamins", "riboflavin", "405"); |
87 |
0 |
addNutrient("Vitamins", "niacin", "406"); |
88 |
0 |
addNutrient("Vitamins", "panto_acid", "410"); |
89 |
0 |
addNutrient("Vitamins", "folate", "417"); |
90 |
|
|
91 |
0 |
addNutrient("Lipids", "saturated", "606"); |
92 |
0 |
addNutrient("Lipids", "monounsaturated", "645"); |
93 |
0 |
addNutrient("Lipids", "polyunsaturated", "646"); |
94 |
0 |
addNutrient("Lipids", "transfats", "605"); |
95 |
0 |
addNutrient("Lipids", "cholesterol", "601"); |
96 |
0 |
addNutrient("Lipids", "phytosterol", "636"); |
97 |
|
|
98 |
0 |
addNutrient("Lipids", "omega3", "621"); |
99 |
0 |
addNutrient("Lipids", "omega3", "629"); |
100 |
0 |
addNutrient("Lipids", "omega3", "631"); |
101 |
0 |
addNutrient("Lipids", "omega3", "851"); |
102 |
|
|
103 |
0 |
addNutrient("Lipids", "omega6", "672"); |
104 |
0 |
addNutrient("Lipids", "omega6", "675"); |
105 |
0 |
addNutrient("Lipids", "omega6", "685"); |
106 |
0 |
} |
107 |
|
|
108 |
|
private static void addNutrient(String table, String tag, String nid) { |
109 |
0 |
USDANutrientInfo ni = new USDANutrientInfo(); |
110 |
0 |
ni.table = table; |
111 |
0 |
ni.tag = tag; |
112 |
0 |
getNutrientMap().put(nid, ni); |
113 |
0 |
} |
114 |
|
|
115 |
|
public static HashMap getNutrientMap() { |
116 |
0 |
if (nutrientMap == null) { |
117 |
0 |
nutrientMap = new HashMap(); |
118 |
0 |
makeNutrientMap(); |
119 |
|
} |
120 |
0 |
return nutrientMap; |
121 |
|
} |
122 |
|
} |