Class TLcyCompositeModelMeasureProviderFactory
- All Implemented Interfaces:
ILcdModelMeasureProviderFactory,Iterable<ILcdModelMeasureProviderFactory>
Composite implementation (see composite design pattern) of ILcdModelMeasureProviderFactory. It
keeps a list of associated ILcdModelMeasureProviderFactory instances: one can add and remove other
ILcdModelMeasureProviderFactory instances to this ILcdModelMeasureProviderFactory.
When creating a new TLcyCompositeModelMeasureProviderFactory using the default
constructor (see TLcyCompositeModelMeasureProviderFactory()), the created instance will
only work on/with the ILcdModelMeasureProviderFactorys registered
on this composite instance (see addModelMeasureProviderFactory(com.luciad.util.measure.ILcdModelMeasureProviderFactory)
and removeModelMeasureProviderFactory(com.luciad.util.measure.ILcdModelMeasureProviderFactory)).
When creating a new TLcyCompositeModelMeasureProviderFactory using the constructor
specifying an ILcyLucyEnv instance (see TLcyCompositeModelMeasureProviderFactory(com.luciad.lucy.ILcyLucyEnv)), the created instance will
work on the Lucy back-end services. It will use
all registered ILcdModelMeasureProviderFactory instances of the
Lucy back-end, adding and/or removing an ILcdModelMeasureProviderFactory will
add/remove the ILcdModelMeasureProviderFactory as service from Lucy, ... .
This class can for example be used to retrieve measures for a view:
TLcyCompositeModelMeasureProviderFactory factory = new TLcyCompositeModelMeasureProviderFactory( lucyEnv );
TLcdGXYViewMeasureProvider measureProvider = new TLcdGXYViewMeasureProvider( view, Collections.singletonList( compositeModelMeasureProvider ) );
ALcdMeasureProvider.Parameters parameters = ALcdMeasureProvider.Parameters.newBuilder().build();
List<TLcdISO19103Measure[]> measures = measureProvider.retrieveMeasuresAt( point, pointReference, parameters );
- Since:
- 2013.0
-
Field Summary
Fields inherited from class com.luciad.lucy.util.TLcyGenericComposite
PRIORITY_DEFAULT, PRIORITY_FALLBACK -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Construct aTLcyCompositeModelMeasureProviderFactoryworking on the Lucy back-end. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory) Adds the givenILcdModelMeasureProviderFactoryto this composite measure provider factory.voidaddModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory, int aPriority) Adds the givenILcdModelMeasureProviderFactoryto this composite measure provider factory, with the given priority.createMeasureProvider(ILcdModel aModel) Creates a new measure provider, based on the given model, ornullif no measure provider can be created for the given model.getList()Returns an unmodifiableListcontaining all registered instances ofILcdModelMeasureProviderFactory.voidremoveModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory) Removes the givenILcdModelMeasureProviderFactoryfrom this composite measure provider factory.Methods inherited from class com.luciad.lucy.util.TLcyGenericComposite
add, add, getPriority, iterator, removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TLcyCompositeModelMeasureProviderFactory
public TLcyCompositeModelMeasureProviderFactory()Default constructor. No
ILcdModelMeasureProviderFactorys are associated.The created instance will only work on the
ILcdModelMeasureProviderFactoryinstances registered to it. If you want to use all registeredILcdModelMeasureProviderFactoryinstances of the Lucy back-end, useTLcyCompositeModelMeasureProviderFactory(com.luciad.lucy.ILcyLucyEnv)instead.- See Also:
-
TLcyCompositeModelMeasureProviderFactory
Construct a
TLcyCompositeModelMeasureProviderFactoryworking on the Lucy back-end.It will use all
ILcdModelMeasureProviderFactoryinstances registered to the back-end, and adding and/or removingILcdModelMeasureProviderFactorys to/from thisILcdModelMeasureProviderFactorywill respectively add/remove it as service from the back-end.If you want to create a
TLcyCompositeModelMeasureProviderFactorywhich does not use the back-end, useTLcyCompositeModelMeasureProviderFactory()instead.- Parameters:
aLucyEnv- The Lucy back-end.- See Also:
-
-
Method Details
-
createMeasureProvider
Description copied from interface:ILcdModelMeasureProviderFactoryCreates a new measure provider, based on the given model, ornullif no measure provider can be created for the given model.- Specified by:
createMeasureProviderin interfaceILcdModelMeasureProviderFactory- Parameters:
aModel- a model.- Returns:
- a measure provider, or
nullif no measure provider can be created for the given model.
-
addModelMeasureProviderFactory
public void addModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory) Adds the given
ILcdModelMeasureProviderFactoryto this composite measure provider factory.If the constructor specifying an
ILcyLucyEnvis used, theILcdModelMeasureProviderFactorywill be registered as a service on the Lucy back-end (seeILcyLucyEnv.addService(Object, int)). When callingILcyLucyEnv.getServices(Class)afterwards,aModelMeasureProviderFactorywill only be included in the returned list when the requested class wasILcdModelMeasureProviderFactory.class.
Note: if you want to remove the registeredILcdModelMeasureProviderFactoryafterwards, useremoveModelMeasureProviderFactoryand notILcyLucyEnv.removeService(Object).- Parameters:
aModelMeasureProviderFactory- the measure provider- See Also:
-
addModelMeasureProviderFactory
public void addModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory, int aPriority) Adds the given
ILcdModelMeasureProviderFactoryto this composite measure provider factory, with the given priority.If the constructor specifying an
ILcyLucyEnvis used, theILcdModelMeasureProviderFactorywill be registered as a service on the Lucy back-end (seeILcyLucyEnv.addService(Object, int)). When callingILcyLucyEnv.getServices(Class)afterwards,aModelMeasureProviderFactorywill only be included in the returned list when the requested class wasILcdModelMeasureProviderFactory.class.
Note: if you want to remove the registeredILcdModelMeasureProviderFactoryafterwards, useremoveModelMeasureProviderFactoryand notILcyLucyEnv.removeService(Object).- Parameters:
aModelMeasureProviderFactory- the measure provideraPriority- the priority- See Also:
-
removeModelMeasureProviderFactory
public void removeModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory) Removes the given
ILcdModelMeasureProviderFactoryfrom this composite measure provider factory. If the givenILcdModelMeasureProviderFactorywas never added before, nothing happens.If the constructor specifying an
ILcyLucyEnvis used, theILcdModelMeasureProviderFactorywill be removed as service from the Lucy back-end (seeILcyLucyEnv.removeService(Object)).
Note: it is only possible to removeILcdModelMeasureProviderFactoryinstances which were registered using theaddModelMeasureProviderFactory(com.luciad.util.measure.ILcdModelMeasureProviderFactory)method.- Parameters:
aModelMeasureProviderFactory- AILcdModelMeasureProviderFactoryto remove.- See Also:
-
getList
Returns an unmodifiable
Listcontaining all registered instances ofILcdModelMeasureProviderFactory.- Overrides:
getListin classTLcyGenericComposite<ILcdModelMeasureProviderFactory>- Returns:
- an unmodifiable
Listcontaining all registered instances ofILcdModelMeasureProviderFactory.
-