Class Applicability
java.lang.Object
de.hsh.graja.comment.applicability.Applicability
- All Implemented Interfaces:
Applicable,Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ApplicabilityApplicability with levelLevel.SEVEREand audienceAudience.BOTH.static final ApplicabilityApplicability with levelLevel.ALLand 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).booleanimplements the contract ofObject.equals(Object).getLevel()inthashCode()implements the contract ofObject.hashCode().static Applicabilityintersection(Applicability[] applicabilities) Returns the lowest (= least severe level / smallest audience) applicability of given applicabilitystatic ApplicabilityReturns the lower (= less severe level / smaller audience) applicability of a and bbooleanbooleantoString()static Applicabilityunion(Applicability[] applicabilities) Returns the highest (= most severe level / broadest audience) applicability of given applicabilities.static Applicabilityunion(Applicability a, Applicability b) Returns the higher (= more severe level / broader audience) applicability of a and b
-
Field Details
-
MAXIMUM_APPLICABILITY
Applicability with levelLevel.SEVEREand audienceAudience.BOTH. -
MINIMUM_APPLICABILITY
Applicability with levelLevel.ALLand 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:ApplicableCalculate 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_APPLICABILITYis returned.- Specified by:
calcApplicabilityin 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).
-