public class TLcyCompositeModelMeasureProviderFactory extends TLcyGenericComposite<ILcdModelMeasureProviderFactory> implements 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 );
PRIORITY_DEFAULT, PRIORITY_FALLBACK
Constructor and Description |
---|
TLcyCompositeModelMeasureProviderFactory()
Default constructor.
|
TLcyCompositeModelMeasureProviderFactory(ILcyLucyEnv aLucyEnv)
Construct a
TLcyCompositeModelMeasureProviderFactory working on the Lucy back-end. |
Modifier and Type | Method and Description |
---|---|
void |
addModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory)
Adds the given
ILcdModelMeasureProviderFactory to this composite measure provider
factory. |
void |
addModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory,
int aPriority)
Adds the given
ILcdModelMeasureProviderFactory to this composite measure provider
factory, with the given priority. |
ALcdMeasureProvider |
createMeasureProvider(ILcdModel aModel)
Creates a new measure provider, based on the given model, or
null if no
measure provider can be created for the given model. |
List<ILcdModelMeasureProviderFactory> |
getList()
Returns an unmodifiable
List containing all registered instances of
ILcdModelMeasureProviderFactory . |
void |
removeModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory)
Removes the given
ILcdModelMeasureProviderFactory from this composite measure provider
factory. |
add, add, getPriority, iterator, remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
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 registered ILcdModelMeasureProviderFactory
instances
of the Lucy back-end, use TLcyCompositeModelMeasureProviderFactory(com.luciad.lucy.ILcyLucyEnv)
instead.
public TLcyCompositeModelMeasureProviderFactory(ILcyLucyEnv aLucyEnv)
Construct a TLcyCompositeModelMeasureProviderFactory
working on the Lucy back-end.
It will use all ILcdModelMeasureProviderFactory
instances registered to the back-end, and
adding and/or removing ILcdModelMeasureProviderFactory
s to/from this
ILcdModelMeasureProviderFactory
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, use TLcyCompositeModelMeasureProviderFactory()
instead.
aLucyEnv
- The Lucy back-end.TLcyCompositeModelMeasureProviderFactory()
,
ILcyLucyEnv.addService(Object, int)
,
ILcyLucyEnv.removeService(Object)
public ALcdMeasureProvider createMeasureProvider(ILcdModel aModel)
ILcdModelMeasureProviderFactory
null
if no
measure provider can be created for the given model.createMeasureProvider
in interface ILcdModelMeasureProviderFactory
aModel
- a model.null
if no measure provider can be created for the given model.public void addModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory)
Adds the given ILcdModelMeasureProviderFactory
to this composite measure provider
factory.
If the constructor specifying an ILcyLucyEnv
is used, the
ILcdModelMeasureProviderFactory
will be registered as a service on the Lucy back-end
(see ILcyLucyEnv.addService(Object, int)
). When calling ILcyLucyEnv.getServices(Class)
afterwards, aModelMeasureProviderFactory
will only be included in the returned list when the requested class was
ILcdModelMeasureProviderFactory.class
.
Note: if you want to remove the registered ILcdModelMeasureProviderFactory
afterwards, use removeModelMeasureProviderFactory
and not ILcyLucyEnv.removeService(Object)
.
aModelMeasureProviderFactory
- the measure providerremoveModelMeasureProviderFactory(com.luciad.util.measure.ILcdModelMeasureProviderFactory)
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, the
ILcdModelMeasureProviderFactory
will be registered as a service on the Lucy back-end
(see ILcyLucyEnv.addService(Object, int)
). When calling ILcyLucyEnv.getServices(Class)
afterwards, aModelMeasureProviderFactory
will only be included in the returned list when the requested class was
ILcdModelMeasureProviderFactory.class
.
Note: if you want to remove the registered ILcdModelMeasureProviderFactory
afterwards, use removeModelMeasureProviderFactory
and not ILcyLucyEnv.removeService(Object)
.
aModelMeasureProviderFactory
- the measure provideraPriority
- the priorityremoveModelMeasureProviderFactory(com.luciad.util.measure.ILcdModelMeasureProviderFactory)
public void removeModelMeasureProviderFactory(ILcdModelMeasureProviderFactory aModelMeasureProviderFactory)
Removes the given ILcdModelMeasureProviderFactory
from this composite measure provider
factory. If the given ILcdModelMeasureProviderFactory
was never added before, nothing
happens.
If the constructor specifying an ILcyLucyEnv
is used, the
ILcdModelMeasureProviderFactory
will be removed as service from the Lucy back-end
(see ILcyLucyEnv.removeService(Object)
).
Note: it is only possible to remove ILcdModelMeasureProviderFactory
instances
which were registered using the addModelMeasureProviderFactory(com.luciad.util.measure.ILcdModelMeasureProviderFactory)
method.
aModelMeasureProviderFactory
- A ILcdModelMeasureProviderFactory
to remove.addModelMeasureProviderFactory(com.luciad.util.measure.ILcdModelMeasureProviderFactory)
public List<ILcdModelMeasureProviderFactory> getList()
Returns an unmodifiable List
containing all registered instances of
ILcdModelMeasureProviderFactory
.
getList
in class TLcyGenericComposite<ILcdModelMeasureProviderFactory>
List
containing all registered instances of
ILcdModelMeasureProviderFactory
.