Class Applicability
java.lang.Object
de.hsh.graja.comment.applicability.Applicability
- All Implemented Interfaces:
Applicable
,Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Applicability
Applicability with levelLevel.SEVERE
and audienceAudience.BOTH
.static final Applicability
Applicability with levelLevel.ALL
and audienceAudience.NONE
. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalcApplicability
(ApplicabilityFilter filter) Calculate the applicability of a comment or for referenced comments (so called dependencies).boolean
implements the contract ofObject.equals(Object)
.getLevel()
int
hashCode()
implements the contract ofObject.hashCode()
.static Applicability
intersection
(Applicability[] applicabilities) Returns the lowest (= least severe level / smallest audience) applicability of given applicabilitystatic Applicability
Returns the lower (= less severe level / smaller audience) applicability of a and bboolean
boolean
toString()
static Applicability
union
(Applicability[] applicabilities) Returns the highest (= most severe level / broadest audience) applicability of given applicabilities.static Applicability
union
(Applicability a, Applicability b) Returns the higher (= more severe level / broader audience) applicability of a and b
-
Field Details
-
MAXIMUM_APPLICABILITY
Applicability with levelLevel.SEVERE
and audienceAudience.BOTH
. -
MINIMUM_APPLICABILITY
Applicability with levelLevel.ALL
and audienceAudience.NONE
.
-
-
Constructor Details
-
Applicability
Create an instance- Parameters:
level
- levelaudience
- audience
-
-
Method Details
-
getLevel
- Returns:
- level
-
getAudience
- Returns:
- audiencne
-
toString
-
isMinimum
public boolean isMinimum()- Returns:
- true, if this applicability equals
MINIMUM_APPLICABILITY
.
-
isMaximum
public boolean isMaximum()- Returns:
- true, if this applicability equals
MAXIMUM_APPLICABILITY
.
-
union
Returns the higher (= more severe level / broader audience) applicability of a and b- Parameters:
a
- one applicabilityb
- another applicability- Returns:
- the higher applicability of the two parameters
-
intersection
Returns the lower (= less severe level / smaller audience) applicability of a and b- Parameters:
a
- one applicabilityb
- another applicability- Returns:
- the lower applicability of the two parameters
-
intersection
Returns the lowest (= least severe level / smallest audience) applicability of given applicability- Parameters:
applicabilities
- given applicabilities- Returns:
- lowest applicability
-
union
Returns the highest (= most severe level / broadest audience) applicability of given applicabilities.- Parameters:
applicabilities
- given applicabilities- Returns:
- highest applicability
-
calcApplicability
Description copied from interface:Applicable
Calculate the applicability of a comment or for referenced comments (so called dependencies). The calculated applicability might result from a union or intersection of grouped dependencies. The calculation leaves out artifacts that do not pass the givenfilter
. If no applicability can be calculated, because all relevant artifacts are filtered out,MINIMUM_APPLICABILITY
is returned.- Specified by:
calcApplicability
in interfaceApplicable
- Parameters:
filter
- filter- Returns:
- this, if this applicability passes the given filter. Otherwise
MINIMUM_APPLICABILITY
.
-
hashCode
public int hashCode()implements the contract ofObject.hashCode()
. -
equals
implements the contract ofObject.equals(Object)
.
-