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
ConstructorDescriptionDefault constructor.Construct aTLcyCompositeModelMeasureProviderFactory
working on the Lucy back-end. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addModelMeasureProviderFactory
(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory) Adds the givenILcdModelMeasureProviderFactory
to this composite measure provider factory.void
addModelMeasureProviderFactory
(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory, int aPriority) Adds the givenILcdModelMeasureProviderFactory
to this composite measure provider factory, with the given priority.createMeasureProvider
(ILcdModel aModel) Creates a new measure provider, based on the given model, ornull
if no measure provider can be created for the given model.getList()
Returns an unmodifiableList
containing all registered instances ofILcdModelMeasureProviderFactory
.void
removeModelMeasureProviderFactory
(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory) Removes the givenILcdModelMeasureProviderFactory
from this composite measure provider factory.Methods inherited from class com.luciad.lucy.util.TLcyGenericComposite
add, add, getPriority, iterator, remove
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TLcyCompositeModelMeasureProviderFactory
public TLcyCompositeModelMeasureProviderFactory()Default constructor. No
ILcdModelMeasureProviderFactory
s are associated.The created instance will only work on the
ILcdModelMeasureProviderFactory
instances registered to it. If you want to use all registeredILcdModelMeasureProviderFactory
instances of the Lucy back-end, useTLcyCompositeModelMeasureProviderFactory(com.luciad.lucy.ILcyLucyEnv)
instead.- See Also:
-
TLcyCompositeModelMeasureProviderFactory
Construct a
TLcyCompositeModelMeasureProviderFactory
working on the Lucy back-end.It will use all
ILcdModelMeasureProviderFactory
instances registered to the back-end, and adding and/or removingILcdModelMeasureProviderFactory
s to/from thisILcdModelMeasureProviderFactory
will respectively add/remove it as service from the back-end.If you want to create a
TLcyCompositeModelMeasureProviderFactory
which does not use the back-end, useTLcyCompositeModelMeasureProviderFactory()
instead.- Parameters:
aLucyEnv
- The Lucy back-end.- See Also:
-
-
Method Details
-
createMeasureProvider
Description copied from interface:ILcdModelMeasureProviderFactory
Creates a new measure provider, based on the given model, ornull
if no measure provider can be created for the given model.- Specified by:
createMeasureProvider
in interfaceILcdModelMeasureProviderFactory
- Parameters:
aModel
- a model.- Returns:
- a measure provider, or
null
if no measure provider can be created for the given model.
-
addModelMeasureProviderFactory
public void addModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory) Adds the given
ILcdModelMeasureProviderFactory
to this composite measure provider factory.If the constructor specifying an
ILcyLucyEnv
is used, theILcdModelMeasureProviderFactory
will be registered as a service on the Lucy back-end (seeILcyLucyEnv.addService(Object, int)
). When callingILcyLucyEnv.getServices(Class)
afterwards,aModelMeasureProviderFactory
will only be included in the returned list when the requested class wasILcdModelMeasureProviderFactory.class
.
Note: if you want to remove the registeredILcdModelMeasureProviderFactory
afterwards, useremoveModelMeasureProviderFactory
and notILcyLucyEnv.removeService(Object)
.- Parameters:
aModelMeasureProviderFactory
- the measure provider- See Also:
-
addModelMeasureProviderFactory
public void addModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory, int aPriority) Adds the given
ILcdModelMeasureProviderFactory
to this composite measure provider factory, with the given priority.If the constructor specifying an
ILcyLucyEnv
is used, theILcdModelMeasureProviderFactory
will be registered as a service on the Lucy back-end (seeILcyLucyEnv.addService(Object, int)
). When callingILcyLucyEnv.getServices(Class)
afterwards,aModelMeasureProviderFactory
will only be included in the returned list when the requested class wasILcdModelMeasureProviderFactory.class
.
Note: if you want to remove the registeredILcdModelMeasureProviderFactory
afterwards, useremoveModelMeasureProviderFactory
and notILcyLucyEnv.removeService(Object)
.- Parameters:
aModelMeasureProviderFactory
- the measure provideraPriority
- the priority- See Also:
-
removeModelMeasureProviderFactory
public void removeModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory) Removes the given
ILcdModelMeasureProviderFactory
from this composite measure provider factory. If the givenILcdModelMeasureProviderFactory
was never added before, nothing happens.If the constructor specifying an
ILcyLucyEnv
is used, theILcdModelMeasureProviderFactory
will be removed as service from the Lucy back-end (seeILcyLucyEnv.removeService(Object)
).
Note: it is only possible to removeILcdModelMeasureProviderFactory
instances which were registered using theaddModelMeasureProviderFactory(com.luciad.util.measure.ILcdModelMeasureProviderFactory)
method.- Parameters:
aModelMeasureProviderFactory
- AILcdModelMeasureProviderFactory
to remove.- See Also:
-
getList
Returns an unmodifiable
List
containing all registered instances ofILcdModelMeasureProviderFactory
.- Overrides:
getList
in classTLcyGenericComposite<ILcdModelMeasureProviderFactory>
- Returns:
- an unmodifiable
List
containing all registered instances ofILcdModelMeasureProviderFactory
.
-