public abstract class BaseCoverageDefinition extends DefinitionalObject
Modifier and Type | Method and Description |
---|---|
void |
addAsset(AssetDefinition assetDefinition)
Add an asset to the coverage definition.
|
void |
addAsset(Object assetKey,
AccessQuery query)
Add an asset to the coverage definition.
|
void |
addAssetRange(Iterable<? extends AssetDefinition> assets)
Add a range of assets to the coverage definition.
|
protected abstract boolean |
checkForSameDefinition(BaseCoverageDefinition other)
Checks to determine if another instance has the same definition as this instance and
returns
true if it does. |
protected boolean |
checkForSameDefinition(DefinitionalObject other)
Checks to determine if another instance has the same definition as this instance and
returns
true if it does. |
protected int |
computeCurrentDefinitionHashCode()
Computes a hash code based on the current properties of this object.
|
abstract CoverageGridPointWithResults |
createGridPoint(CoverageGridPoint coverageGridPoint)
Creates a
CoverageGridPointWithResults suitable for computing coverage. |
void |
enumerateDependencies(DependencyEnumerator enumerator)
Enumerates the dependencies of this object by calling
DependencyEnumerator#enumerate(T) for each object that this object directly depends upon. |
protected void |
freezeAggregatedObjects()
Called by
DefinitionalObject.freeze() to also freeze any objects that are considered to be a part of this object. |
protected ArrayList<AssetDefinition> |
getAssetDefinitions()
Gets the asset definitions defined for this coverage definition.
|
List<AssetDefinition> |
getAssets()
Gets a read-only collection of assets which provide coverage over the grid.
|
CoverageFilter |
getFilter()
Gets the constraint which indicates the bound on the number of assets which must have access
to a grid point in order to provide coverage.
|
ICoverageGrid |
getGrid()
Gets the grid used to generate points of interest over which to analyze coverage.
|
protected IServiceProvider |
getGridPointService()
Gets the service used at each grid point.
|
boolean |
getMultithreadCoverage()
Gets a value indicating whether to use multiple threads to compute coverage.
|
void |
removeAllAssets()
Removes all asset definitions for all assets from this coverage definition.
|
void |
removeAsset(AssetDefinition assetDefinition)
Removes the specified asset definition from the list of assets.
|
void |
removeAsset(Object asset)
Removes the specified asset from the list of assets.
|
protected void |
setAssetDefinitions(ArrayList<AssetDefinition> value)
Sets the asset definitions defined for this coverage definition.
|
void |
setFilter(CoverageFilter value)
Sets the constraint which indicates the bound on the number of assets which must have access
to a grid point in order to provide coverage.
|
void |
setGrid(ICoverageGrid value)
Sets the grid used to generate points of interest over which to analyze coverage.
|
protected void |
setGridPointService(IServiceProvider value)
Sets the service used at each grid point.
|
void |
setMultithreadCoverage(boolean value)
Sets a value indicating whether to use multiple threads to compute coverage.
|
protected void |
validateProperties()
Validates all of the properties of the coverage definition.
|
areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, clone, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, dictionaryItemsAreSameDefinition, freeze, getCollectionHashCode, getCollectionHashCode, getCollectionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDictionaryHashCode, getIsFrozen, isSameDefinition, throwIfFrozen
protected final boolean checkForSameDefinition(DefinitionalObject other)
true
if it does. Derived classes MUST override this method and check
all new fields introduced by the derived class for definitional equivalence. It is NOT necessary
to check base class fields because the base class will already have done that. When overriding this method,
you should NOT call the base implementation because it will return false
for all derived-class instances.
Derived classes should check the type of other
to preserve the symmetric nature of IEquatableDefinition.isSameDefinition(java.lang.Object)
.checkForSameDefinition
in class DefinitionalObject
other
- The other instance to compare to this one.true
if the two objects are defined equivalently; otherwise false
.protected abstract boolean checkForSameDefinition(BaseCoverageDefinition other)
true
if it does. Derived classes MUST override this method and check
all new fields introduced by the derived class for definitional equivalence. It is NOT necessary
to check base class fields because the base class will already have done that. When overriding this method,
you should NOT call the base implementation because it will return false
for all derived-class instances.
Derived classes should check the type of other
to preserve the symmetric nature of IEquatableDefinition.isSameDefinition(java.lang.Object)
.other
- The other instance to compare to this one.true
if the two objects are defined equivalently; otherwise false
.protected int computeCurrentDefinitionHashCode()
BaseCoverageDefinition.checkForSameDefinition(agi.foundation.infrastructure.DefinitionalObject)
method.computeCurrentDefinitionHashCode
in class DefinitionalObject
public void enumerateDependencies(DependencyEnumerator enumerator)
DependencyEnumerator#enumerate(T)
for each object that this object directly depends upon.
Derived classes which contain additional dependencies MUST override this method, call the base
implementation, and enumerate dependencies introduced by the derived class.enumerateDependencies
in interface IEnumerateDependencies
enumerateDependencies
in class DefinitionalObject
enumerator
- The enumerator that is informed of the dependencies of this object.protected void freezeAggregatedObjects()
DefinitionalObject.freeze()
to also freeze any objects that are considered to be a part of this object.
Derived classes which contain additional aggregated objects MUST override this method, call the base
implementation, and freeze aggregated objects introduced by the derived class. The objects that need to be
frozen in this method are frequently created in this object's constructor and are not settable via
properties.freezeAggregatedObjects
in class DefinitionalObject
protected void validateProperties()
This should be called in any derived coverage definition types before computing coverage.
PropertyInvalidException
- Thrown when Grid
(get
/ set
), GridPointService
(get
/ set
), or Filter
(get
/ set
) is null
.IllegalStateException
- Thrown when any of the following conditions are met:
@Nonnull public abstract CoverageGridPointWithResults createGridPoint(CoverageGridPoint coverageGridPoint)
CoverageGridPointWithResults
suitable for computing coverage.coverageGridPoint
- The geometric grid point produced by the gridding algorithm.CoverageGridPointWithResults
.@Nonnull public final List<AssetDefinition> getAssets()
public final CoverageFilter getFilter()
By default, the constraint is: at least one asset (CoverageFilterType.AT_LEAST_N
).
public final void setFilter(CoverageFilter value)
By default, the constraint is: at least one asset (CoverageFilterType.AT_LEAST_N
).
public final ICoverageGrid getGrid()
public final void setGrid(ICoverageGrid value)
protected final IServiceProvider getGridPointService()
IPlaceHolderService
in the case of delegate based coverage definitions such as, MaterializedSpatiallyPartitionedCoverageDefinition
.
This should be an Object
with an ILocationPointService
in the case of template based coverage definitions such as ParameterizedSpatiallyPartitionedCoverageDefinition
.protected final void setGridPointService(IServiceProvider value)
IPlaceHolderService
in the case of delegate based coverage definitions such as, MaterializedSpatiallyPartitionedCoverageDefinition
.
This should be an Object
with an ILocationPointService
in the case of template based coverage definitions such as ParameterizedSpatiallyPartitionedCoverageDefinition
.public final boolean getMultithreadCoverage()
public final void setMultithreadCoverage(boolean value)
public final void addAsset(AssetDefinition assetDefinition)
assetDefinition
- The asset definition to add.public final void addAsset(Object assetKey, AccessQuery query)
assetKey
- The asset to add, which will be used as a reference key when retrieving data.query
- The query that must be satisfied for the asset to provide coverage.public final void addAssetRange(@Nonnull Iterable<? extends AssetDefinition> assets)
assets
- The set of assets to add.public final void removeAsset(AssetDefinition assetDefinition)
If the specified definition has been added to the list multiple times, this method will remove the first occurrence.
assetDefinition
- The asset definition to remove.public final void removeAsset(Object asset)
If the list of assets contains multiple AssetDefinition
instances involving this
asset, all of them will be removed by this method.
asset
- The asset to remove.public final void removeAllAssets()
@Nonnull protected final ArrayList<AssetDefinition> getAssetDefinitions()
protected final void setAssetDefinitions(@Nonnull ArrayList<AssetDefinition> value)