Line | |
---|
1 | package tudelft.mentalhealth.motivatepersisting;
|
---|
2 |
|
---|
3 | import java.util.Arrays;
|
---|
4 | import java.util.Collections;
|
---|
5 | import java.util.List;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * The catogory (main content type) of a possible Statement.
|
---|
9 | */
|
---|
10 | enum Category {
|
---|
11 | EMPATHY(Subcategory.NEGATIVE), //
|
---|
12 | MOTIVATION(Subcategory.COMPLIMENT, Subcategory.GOONLIKETHIS, Subcategory.ITSGOINGWELL, Subcategory.HOLDON), //
|
---|
13 | GIVEPERSPECTIVE, //
|
---|
14 | TOGETHER, //
|
---|
15 | FUTURE(Subcategory.PCL), //
|
---|
16 | NOTEPCL(Subcategory.STABLE, Subcategory.DROPPING, Subcategory.RISING), //
|
---|
17 | NOTETRUST(Subcategory.HIGH, Subcategory.LOW);
|
---|
18 |
|
---|
19 | private List<Subcategory> allowedSubcategories;
|
---|
20 |
|
---|
21 | Category(Subcategory... subcategories) {
|
---|
22 | this.allowedSubcategories = Arrays.asList(subcategories);
|
---|
23 | }
|
---|
24 |
|
---|
25 | /**
|
---|
26 | *
|
---|
27 | * @param sub
|
---|
28 | * @return true iff sub is an allowed subcategory for this category.
|
---|
29 | */
|
---|
30 | public boolean isSubcategoryAllowed(Subcategory sub) {
|
---|
31 | return allowedSubcategories.contains(sub);
|
---|
32 | }
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * @return the possible {@link Subcategory}s of this type. Returns empty list if
|
---|
36 | * this category has no subcategories.
|
---|
37 | */
|
---|
38 | public List<Subcategory> getSubCategories() {
|
---|
39 | return Collections.unmodifiableList(allowedSubcategories);
|
---|
40 | }
|
---|
41 |
|
---|
42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.