Android Open Source - android-ocw Category






From Project

Back to project page android-ocw.

License

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.

Java Source Code

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;
  }
}




Java Source Code List

app.ocw.CourseAdapter.java
app.ocw.CourseDetailActivity.java
app.ocw.CourseListActivity.java
app.ocw.CourseSearchActivity.java
app.ocw.api.CategoryListAPI.java
app.ocw.api.CourseSearchAPI.java
app.ocw.api.ProviderListAPI.java
app.ocw.model.Category.java
app.ocw.model.CourseDetail.java
app.ocw.model.Course.java
app.ocw.model.Provider.java
app.ocw.task.GetCategoryListTask.java
app.ocw.task.GetProviderListTask.java
app.ocw.task.SearchCoursesTask.java