Class ApplicabilityDependencyGroup
java.lang.Object
de.hsh.graja.comment.applicability.ApplicabilityDependencyGroup
- All Implemented Interfaces:
ApplicabilityDependency
,Applicable
,Serializable
,Cloneable
- Direct Known Subclasses:
ApplicabilityDependencyIntersection
,ApplicabilityDependencyUnion
public abstract class ApplicabilityDependencyGroup
extends Object
implements ApplicabilityDependency
Abstract base class of union or intersection set of
ApplicabilityDependency
objects.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HashSet<ApplicabilityDependency>
protected ApplicabilityReducer
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
create an empty setprotected
ApplicabilityDependencyGroup
(ApplicabilityReducer reducer, ApplicabilityDependency... dependencies) create a given setprotected
ApplicabilityDependencyGroup
(ApplicabilityReducer reducer, Iterable<? extends ApplicabilityDependency> dependencies) create a given set -
Method Summary
Modifier and TypeMethodDescriptionvoid
add a dependencycalcApplicability
(ApplicabilityFilter filter) Calculate the applicability of a comment or for referenced comments (so called dependencies).abstract ApplicabilityDependencyGroup
clone()
boolean
implements the contract ofObject.equals(Object)
.int
hashCode()
implements the contract ofObject.hashCode()
.
-
Field Details
-
dependencies
-
reducer
-
-
Constructor Details
-
ApplicabilityDependencyGroup
protected ApplicabilityDependencyGroup(ApplicabilityReducer reducer, Iterable<? extends ApplicabilityDependency> dependencies) create a given set -
ApplicabilityDependencyGroup
protected ApplicabilityDependencyGroup(ApplicabilityReducer reducer, ApplicabilityDependency... dependencies) create a given set -
ApplicabilityDependencyGroup
create an empty set
-
-
Method Details
-
clone
- Specified by:
clone
in interfaceApplicabilityDependency
- Overrides:
clone
in classObject
- Returns:
- a clone
-
add
add a dependency- Parameters:
d
- dependency
-
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,Applicability.MINIMUM_APPLICABILITY
is returned.- Specified by:
calcApplicability
in interfaceApplicable
- Parameters:
filter
- filter- Returns:
- the result after evaluating and reducing all depended on applicabilities.
If no depended on artifact passes the filter, the value
reducer.initial()
is returned.
-
hashCode
public int hashCode()implements the contract ofObject.hashCode()
. -
equals
implements the contract ofObject.equals(Object)
.
-