Enum Class Audience
- All Implemented Interfaces:
Serializable
,Comparable<Audience>
,Constable
This enum specifies the audience of a comment. There are basically two audiences: students and teachers. A comment usually has one of the following audience values:
STUDENT
: if the comment is for students only,TEACHER
: if the comment is for teachers only,BOTH
: if the comment is for students and teachers.
A fourth value of this enum is NONE
which is used to characterize e. g. an
empty set of comments, whose target audience is neither teachers nor students.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Audience
Returns the audience resulting from the intersection of two audiences.static Audience
getAudienceUnion
(Audience a, Audience b) Returns the audience resulting from the union of two audiences.boolean
isSubAudienceOfOrEqual
(Audience other) Returns true, if theother
audience is broader than or equal to this audience.static Audience
Returns the enum constant of this class with the specified name.static Audience[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STUDENT
The comment is for students only -
TEACHER
The comment is for teachers only -
BOTH
The comment is for students and teachers -
NONE
The comment is neither for students nor for teachers. This value is used to characterize e. g. an empty set of comments.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isSubAudienceOfOrEqual
Returns true, if the
other
audience is broader than or equal to this audience.- Parameters:
other
- another audience- Returns:
- true, if the
other
audience is broader than or equal to this audience.
-
getAudienceUnion
Returns the audience resulting from the union of two audiences.
- Parameters:
a
- an audienceb
- another audience- Returns:
- the union of both audiences.
-
getAudienceIntersection
Returns the audience resulting from the intersection of two audiences.
- Parameters:
a
- an audienceb
- another audience- Returns:
- the intersection of both audiences.
-