Skip to content

Commit

Permalink
add API to get list of category names
Browse files Browse the repository at this point in the history
  • Loading branch information
slogan621 committed Nov 9, 2020
1 parent 69d973e commit 4d1c023
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class CDTCodesModelList {
private List<CDTCodesModel> m_list = new ArrayList<CDTCodesModel>();
private ArrayList<JSONObject> m_objs = new ArrayList<JSONObject>();
private ArrayList<String> m_strs = new ArrayList<String>();
private ArrayList<String> m_categories = new ArrayList<String>();

public List<CDTCodesModel> getModel() {
return m_list;
Expand All @@ -48,6 +49,10 @@ public ArrayList<String> getModelStrings() {
return m_strs;
}

public ArrayList<String> getCategoryStrings() {
return m_categories;
}

private CDTCodesModelList(){}

synchronized static public CDTCodesModelList getInstance()
Expand All @@ -66,6 +71,7 @@ public boolean setModelData(JSONArray items) {
try {
CDTCodesModel model = new CDTCodesModel(items.getJSONObject(i), false);
m_list.add(model);
m_categories.add(model.getCategory());
m_strs.add(model.repr());
} catch (Exception e) {
ret = false;
Expand Down

0 comments on commit 4d1c023

Please sign in to comment.