Added isSpecial() to check if contrib is to be highlighted

This commit is contained in:
joelmoniz
2014-07-26 17:37:30 +04:00
parent 1106b043d0
commit 0e6827d253

View File

@@ -30,9 +30,10 @@ import processing.core.PApplet;
abstract public class Contribution {
static final String SPECIAL_CATEGORY_NAME = "Starred";
static final List validCategories =
Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware",
"I/O", "Math", "Simulation", "Sound", "Typography",
"I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography",
"Utilities", "Video & Vision", "Other");
//protected String category; // "Sound"
@@ -165,6 +166,19 @@ abstract public class Contribution {
}
/**
* Returns true if the contribution is a starred/recommended contribution, or
* is by the Processing Foundation.
*
* @return
*/
boolean isSpecial() {
if (authorList.indexOf("The Processing Foundation") != -1 || categories.contains(SPECIAL_CATEGORY_NAME))
return true;
return false;
}
/**
* @return a single element list with "Unknown" as the category.
*/