Back to project page android-ocw.
The source code is released under:
GNU General Public License
If you think the Android project android-ocw listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package app.ocw.model; //w ww . j av a 2 s. c om import java.util.ArrayList; import java.util.List; /** * Model for an OCW Category * * @author Nick Ferraro * */ public class Category { private final Category parent; private final String name; private final int courseCount; private final List<Category> children; public Category(String name, int courseCount) { this(name, courseCount, null); } public Category(String name, int courseCount, Category parent) { this.name = (name == null ? "no-name" : name); this.courseCount = courseCount; this.parent = parent; this.children = new ArrayList<Category>(); } public Category getParent() { return this.parent; } public String getName() { return this.name; } public int getCourseCount() { return this.courseCount; } public List<Category> getChildren() { return this.children; } @Override public String toString() { return this.name; } }