Module net.finmath.lib
Class ProductFactoryCascade<T extends ProductDescriptor>
java.lang.Object
net.finmath.modelling.productfactory.ProductFactoryCascade<T>
- Type Parameters:
- T- The base class of the product descriptors which can be handled by this- ProductFactory.
- All Implemented Interfaces:
- ProductFactory<T>
public class ProductFactoryCascade<T extends ProductDescriptor>
extends Object
implements ProductFactory<T>
Implements a product factory based on a cascade of given factories. When invoking 
getProductFromDescriptor(ProductDescriptor productDescriptor)
 the cascade will query all its individual factories until one builds the product. When querying the factories the cascade will start at index 0.- Version:
- 1.0
- Author:
- Christian Fries, Roland Bachl
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct an empty factory cascade.ProductFactoryCascade(List<ProductFactory<? extends T>> factories)Construct a factory cascade from an ordered list of product factories.
- 
Method SummaryModifier and TypeMethodDescriptionaddFactoryAfter(ProductFactory<? extends T> factory)Add a given factory to the list of factories at the END.addFactoryBefore(ProductFactory<? extends T> factory)Add a given factory to the list of factories at the BEGINNING.DescribedProduct<? extends T>getProductFromDescriptor(ProductDescriptor productDescriptor)Constructs the product from a given product descriptor.
- 
Constructor Details- 
ProductFactoryCascadepublic ProductFactoryCascade()Construct an empty factory cascade. This will build no products until amended.
- 
ProductFactoryCascadeConstruct a factory cascade from an ordered list of product factories. When querying the factories the cascade will start at index 0.- Parameters:
- factories- A list of product factories, i.e. object implementing- ProductFactoryfor the product descriptor- T.
 
 
- 
- 
Method Details- 
addFactoryBeforeAdd a given factory to the list of factories at the BEGINNING.- Parameters:
- factory- The factory to be added.
- Returns:
- Cascade with amended factory list.
 
- 
addFactoryAfterAdd a given factory to the list of factories at the END.- Parameters:
- factory- The factory to be added.
- Returns:
- Cascade with amended factory list.
 
- 
getProductFromDescriptorDescription copied from interface:ProductFactoryConstructs the product from a given product descriptor.- Specified by:
- getProductFromDescriptorin interface- ProductFactory<T extends ProductDescriptor>
- Parameters:
- productDescriptor- A product descriptor.
- Returns:
- An instance of the product describable by this descriptor.
 
 
-