atg.commerce.pricing
Class PropertyAggregator
java.lang.Object
atg.commerce.pricing.Aggregator
atg.commerce.pricing.PropertyAggregator
- Direct Known Subclasses:
- QuantityAggregator
public class PropertyAggregator
- extends Aggregator
An implementation of the Aggregator class. PropertyAggregator is a generic aggregator that allows any numeric
property to be aggregated. The name of the property to be aggregated should be retrieved from the attributes map
and resolved accordingly into a value. From here, aggregation can take place.
Field Summary |
static java.lang.String |
CLASS_VERSION
Class version string |
Method Summary |
protected AggregatorInfo |
calculate(java.lang.String pOperation,
java.lang.Double pAggValueSoFar,
java.lang.Long pQuantityMatched,
java.lang.Double pTargetValue,
CommerceItem pItem,
java.util.Map pAttributes)
This method will calculate (based on the given operation) an aggregated value using pItem. |
java.lang.Number |
parseValue(java.lang.String pValue,
java.lang.Class<?> pType)
Parses a string value and returns a Number representation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CLASS_VERSION
public static java.lang.String CLASS_VERSION
- Class version string
PropertyAggregator
public PropertyAggregator()
calculate
protected AggregatorInfo calculate(java.lang.String pOperation,
java.lang.Double pAggValueSoFar,
java.lang.Long pQuantityMatched,
java.lang.Double pTargetValue,
CommerceItem pItem,
java.util.Map pAttributes)
throws PricingException
- This method will calculate (based on the given operation) an aggregated value using pItem.
- Parameters:
pOperation
- the operation to invoke on the aggregatorpAggValueSoFar
- the aggregated value so far, which may be potentially
derived from many calculations from multiple itemspQuantityMatched
- the number of items that have contributed to the
aggregated valuepTargetValue
- a value specified in the condition/offer of a promotion
which can be used as a target in relation to the aggregated value.
May or may not be relevant to an aggregatorpItem
- the item that is currently being evaluatedpAttributes
- extra parameters
- Returns:
- holds amended aggValueSoFar and quantityMatched values
- Throws:
PricingException
parseValue
public java.lang.Number parseValue(java.lang.String pValue,
java.lang.Class<?> pType)
throws java.lang.NumberFormatException
- Parses a string value and returns a Number representation.
- Parameters:
pValue
- value to be parsedpType
- class type of pValue
- Returns:
- parsed value
- Throws:
java.lang.NumberFormatException
- if pValue could not be parsed