public class AggregationSpec extends Object
Modifier and Type | Field and Description |
---|---|
static EnumAggregationType |
IMPLICIT_AGGREGATION
The default aggregation method used when no value (or null) is set by
setDefaultAggregation(EnumAggregationType) . |
static EnumAggregationErrorStrategy |
IMPLICIT_ERROR_STRATEGY
The default aggregation error strategy used when no value (or null) is set by
setErrorStrategy(EnumAggregationErrorStrategy) . |
static boolean |
IMPLICIT_MULTIVALUE
The default multivalue setting used when no value (or null) is set by
#setDefaultMultivalue(boolean) . |
Constructor and Description |
---|
AggregationSpec()
Create instance with default aggregation settings
(default aggregation ALL, error strategy RETURN_ALL).
|
AggregationSpec(EnumAggregationType defaultAggregation,
Map<String,EnumAggregationType> propertyAggregations,
EnumAggregationErrorStrategy errorStrategy,
Boolean defaultMultivalue,
Map<String,Boolean> propertyMultivalue)
Create instance with all settings specified by parameters.
|
Modifier and Type | Method and Description |
---|---|
EnumAggregationType |
getDefaultAggregation()
Return aggregation method for properties without an explicitly set method.
|
Boolean |
getDefaultMultivalue()
Get the default multivalue setting; if the multivalue setting is set to false,
differences with other conflicting values decrease quality estimate, otherwise they don't.
|
EnumAggregationErrorStrategy |
getEffectiveErrorStrategy()
Returns the effective aggregation error strategy, i.e.
|
EnumAggregationErrorStrategy |
getErrorStrategy()
Return aggregation error strategy.
|
Map<String,EnumAggregationType> |
getPropertyAggregations()
Get aggregation methods explicitly set for properties.
|
Map<String,Boolean> |
getPropertyMultivalue()
Returns explicit multivalue settings for predicates.
|
boolean |
isPropertyMultivalue(String propertyURI)
Return the effective value of the multivalue attribute for a selected property.
|
EnumAggregationType |
propertyAggregationType(String propertyURI)
Return aggregation method for a selected property.
|
void |
setDefaultAggregation(EnumAggregationType defaultAggregation)
Set aggregation method for properties without an explicitly set method.
|
void |
setDefaultMultivalue(Boolean defaultMultivalue)
Sets the default value of the multivalue setting.
|
void |
setErrorStrategy(EnumAggregationErrorStrategy errorStrategy)
Set aggregation error strategy.
|
void |
setPropertyAggregations(Map<String,EnumAggregationType> propertyAggregations)
Set aggregation methods for properties.
|
void |
setPropertyMultivalue(Map<String,Boolean> propertyMultivalue)
Sets explicit multivalue settings per predicate.
|
AggregationSpec |
shallowClone()
Creates a shallow copy of this object.
|
public static final boolean IMPLICIT_MULTIVALUE
#setDefaultMultivalue(boolean)
.public static final EnumAggregationType IMPLICIT_AGGREGATION
setDefaultAggregation(EnumAggregationType)
.public static final EnumAggregationErrorStrategy IMPLICIT_ERROR_STRATEGY
setErrorStrategy(EnumAggregationErrorStrategy)
.public AggregationSpec()
public AggregationSpec(EnumAggregationType defaultAggregation, Map<String,EnumAggregationType> propertyAggregations, EnumAggregationErrorStrategy errorStrategy, Boolean defaultMultivalue, Map<String,Boolean> propertyMultivalue)
defaultAggregation
- aggregation method for properties not included
in propertyAggregations; cannot be nullpropertyAggregations
- aggregation method for properties
as a property URI -> aggregation type map; cannot be nullerrorStrategy
- strategy to use when an aggregation cannot be
applied to a value; cannot be nulldefaultMultivalue
- the default multivalue setting for quality computation;propertyMultivalue
- indicates whether decrease score of a value in presence
of different conflicting values (false) or not (true) for each property;
map of property URI -> multivalue setting for the propertypublic AggregationSpec shallowClone()
public final EnumAggregationErrorStrategy getErrorStrategy()
getEffectiveErrorStrategy()
public final void setErrorStrategy(EnumAggregationErrorStrategy errorStrategy)
errorStrategy
- the new aggregation error strategy;
if null, the implicit value will be effectivepublic final EnumAggregationType getDefaultAggregation()
setPropertyAggregations(Map)
public final void setDefaultAggregation(EnumAggregationType defaultAggregation)
defaultAggregation
- the new default aggregation type;
if null, the implicit value will be effectivepublic final Map<String,EnumAggregationType> getPropertyAggregations()
public final void setPropertyAggregations(Map<String,EnumAggregationType> propertyAggregations)
propertyAggregations
- aggregation method for properties
as a property URI -> aggregation type map; must not be nullpublic final Boolean getDefaultMultivalue()
setPropertyAggregations(Map)
.public final void setDefaultMultivalue(Boolean defaultMultivalue)
defaultMultivalue
- default value of the multivalue setting; null means use the default value
true.getDefaultMultivalue()
public final Map<String,Boolean> getPropertyMultivalue()
getDefaultMultivalue()
public final void setPropertyMultivalue(Map<String,Boolean> propertyMultivalue)
propertyMultivalue
- map of property URI -> the multivalue setting for the propertygetDefaultMultivalue()
public final EnumAggregationErrorStrategy getEffectiveErrorStrategy()
setErrorStrategy(EnumAggregationErrorStrategy)
is not null, return this value, otherwise return
.public EnumAggregationType propertyAggregationType(String propertyURI)
propertyURI
- the URI of a propertypublic boolean isPropertyMultivalue(String propertyURI)
propertyURI
- the URI of a propertygetDefaultMultivalue()
Copyright © 2013. All Rights Reserved.