public class TLcdCompositeModelHeightProviderFactory extends Object implements ILcdModelHeightProviderFactory
ILcdModelHeightProviderFactory
tries to create an
ILcdHeightProvider
using a given list of other
ILcdModelHeightProviderFactory
instances. The first
ILcdModelHeightProviderFactory
that creates a height provider
prevails.
A class that requires a height provider based on a different types of models could construct a suitable factory as follows:
// Create a list of height provider factories that may be relevant
// for different models and different properties.
List<ILcdModelHeightProviderFactory> factories = new ArrayList<ILcdModelHeightProviderFactory>();
factories.add(new TLcdRasterModelHeightProviderFactory());
...
// Create a composite height provider factory.
ILcdModelHeightProviderFactory factory =
new TLcdCompositeModelHeightProviderFactory(factories);
KEY_GEO_REFERENCE
Constructor and Description |
---|
TLcdCompositeModelHeightProviderFactory(List<? extends ILcdModelHeightProviderFactory> aFactories)
Creates a
TLcdCompositeModelHeightProviderFactory with a given list
of ILcdModelHeightProviderFactory instances. |
Modifier and Type | Method and Description |
---|---|
ILcdHeightProvider |
createHeightProvider(ILcdModel aModel,
Map<String,Object> aRequiredProperties,
Map<String,Object> aOptionalProperties)
Returns a height provider for a given
ILcdModel using the given
properties. |
List<ILcdModelHeightProviderFactory> |
getModelHeightProviderFactories()
Returns the list of height providers that this factory uses.
|
public TLcdCompositeModelHeightProviderFactory(List<? extends ILcdModelHeightProviderFactory> aFactories)
TLcdCompositeModelHeightProviderFactory
with a given list
of ILcdModelHeightProviderFactory
instances.aFactories
- a list of ILcdModelHeightProviderFactory
s.public List<ILcdModelHeightProviderFactory> getModelHeightProviderFactories()
public ILcdHeightProvider createHeightProvider(ILcdModel aModel, Map<String,Object> aRequiredProperties, Map<String,Object> aOptionalProperties) throws TLcdMissingPropertyException, TLcdUnsupportedPropertyException
ILcdModelHeightProviderFactory
ILcdModel
using the given
properties. The returned height provider is determined by the implementation,
the ILcdModel
and the given properties.createHeightProvider
in interface ILcdModelHeightProviderFactory
aModel
- an ILcdModel
for which a height provider is created.aRequiredProperties
- the required properties. The properties can be retrieved using a
String
key describing the property type. When not all required properties
are used, an exception is thrown. aRequiredProperties
may be empty but should
not be null
. When an implementation of this interface uses a required
property, it should always remove it from the list of required properties. When the
ILcdHeightProvider
is actually made, implementations should verify that
the list of required properties is empty (and all required properties are used).aOptionalProperties
- the optional properties. The properties can be retrieved using a
String
key describing the property type. The optional properties may or may
not be used by the implementation. aOptionalProperties
may be empty but
should not be null.null
when elevation
is not supported or when no valid height provider can be created.TLcdMissingPropertyException
- when the implementation misses a necessary property.TLcdUnsupportedPropertyException
- when a required property is not used by the
implementation.TLcdModelHeightProviderFactoryUtil