ILcySimulatorModelFactory
@Deprecated public class TLcyCompositeSimulatorModelFactory extends TLcyGenericComposite<ILcySimulatorModelFactory> implementsILcySimulatorModelFactory
A composite implementation of ILcySimulatorModelFactory
according to the
composite design pattern.
When creating a new TLcyCompositeSimulatorModelFactory
using the default
constructor (see TLcyCompositeSimulatorModelFactory()
), the created instance will
only work on/with the ILcySimulatorModelFactorys registered
on this composite instance (see addSimulatorModelFactory(com.luciad.lucy.realtime.ILcySimulatorModelFactory)
and removeSimulatorModelFactory(com.luciad.lucy.realtime.ILcySimulatorModelFactory)
).
When creating a new TLcyCompositeSimulatorModelFactory
using the constructor
specifying an ILcyLucyEnv
instance (see TLcyCompositeSimulatorModelFactory(com.luciad.lucy.ILcyLucyEnv)
, the created instance will
work on the Lucy back-end services. It will use
all registered ILcySimulatorModelFactory instances of the
Lucy back-end, adding and/or removing an ILcySimulatorModelFactory
will
add/remove the ILcySimulatorModelFactory
as service from Lucy, ... .
Creating an ILcdSimulatorModel
for an ILcdModel
using the back-end
based implementation can be done by creating a new instance of this class:
//Create a new instance whenever you need it.
TLcyCompositeSimulatorModelFactory factory = new TLcyCompositeSimulatorModelFactory( aLucyEnv );
if( factory.canCreateSimulatorModel( aModel ) ){
ILcdSimulatorModel simulatorModel = factory.createSimulatorModel( aModel );
}
//There is no need to keep a reference to the composite instance, you can create a new one
//the next time you would need it
factory = null;
PRIORITY_DEFAULT, PRIORITY_FALLBACK
Constructor and Description |
---|
TLcyCompositeSimulatorModelFactory()
Deprecated.
Default constructor.
|
TLcyCompositeSimulatorModelFactory(ILcyLucyEnv aLucyEnv)
Deprecated.
Construct a
TLcyCompositeSimulatorModelFactory working on the Lucy back-end |
Modifier and Type | Method and Description |
---|---|
void |
addSimulatorModelFactory(ILcySimulatorModelFactory aSimulatorModelFactory)
Deprecated.
Adds the given
ILcySimulatorModelFactory to the list of registered simulator
model factories. |
boolean |
canCreateSimulatorModel(ILcdModel aModel)
Deprecated.
This method shall return true if this
ILcySimulatorModelFactory can create
a ILcdSimulatorModel for the given ILcdModel , false other wise |
ILcdSimulatorModel |
createSimulatorModel(ILcdModel aModel)
Deprecated.
Creates a
ILcdSimulatorModel for the given ILcdModel . |
ILcySimulatorModelFactory |
getSimulatorModelFactory(int aIndex)
Deprecated.
Returns the
ILcySimulatorModelFactory at index aIndex . |
int |
getSimulatorModelFactoryCount()
Deprecated.
Returns the number of registered
ILcySimulatorModelFactory instances. |
void |
removeSimulatorModelFactory(ILcySimulatorModelFactory aSimulatorModelFactory)
Deprecated.
Removes the given
ILcySimulatorModelFactory from the list of registered simulator
model factories. |
add, add, getList, getPriority, iterator, remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public TLcyCompositeSimulatorModelFactory()
Default constructor.
The created instance will only work on the ILcySimulatorModelFactory
instances
registered to it. If you want to use all registered ILcySimulatorModelFactory
instances of the Lucy back-end, use TLcyCompositeSimulatorModelFactory(com.luciad.lucy.ILcyLucyEnv)
instead.
public TLcyCompositeSimulatorModelFactory(ILcyLucyEnv aLucyEnv)
Construct a TLcyCompositeSimulatorModelFactory
working on the Lucy back-end
It will use all ILcySimulatorModelFactory
instances registered to the back-end,
and adding and/or removing ILcySimulatorModelFactory
s to/from this
TLcyCompositeSimulatorModelFactory
will respectively add/remove it as service from
the back-end.
If you want to create a TLcyCompositeSimulatorModelFactory
which does not use the
back-end, use TLcyCompositeSimulatorModelFactory()
instead.
aLucyEnv
- The Lucy back-end.TLcyCompositeSimulatorModelFactory()
,
ILcyLucyEnv.addService(Object, int)
,
ILcyLucyEnv.removeService(Object)
public void addSimulatorModelFactory(ILcySimulatorModelFactory aSimulatorModelFactory)
Adds the given ILcySimulatorModelFactory
to the list of registered simulator
model factories.
If the constructor specifying an ILcyLucyEnv
is used, the
ILcySimulatorModelFactory
will be registered as a service on the Lucy back-end
(see ILcyLucyEnv.addService(Object, int)
). When calling ILcyLucyEnv.getServices(Class)
afterwards, aSimulatorModelFactory
will only be included in the returned list when the requested class was
ILcySimulatorModelFactory.class
.
Note: if you want to remove the registered ILcySimulatorModelFactory
afterwards, use removeSimulatorModelFactory(com.luciad.lucy.realtime.ILcySimulatorModelFactory)
and not ILcyLucyEnv.removeService(Object)
.
aSimulatorModelFactory
- The simulator model factory to add. Must not be
null
.removeSimulatorModelFactory(com.luciad.lucy.realtime.ILcySimulatorModelFactory)
public void removeSimulatorModelFactory(ILcySimulatorModelFactory aSimulatorModelFactory)
Removes the given ILcySimulatorModelFactory
from the list of registered simulator
model factories. Nothing will happen if the given factory was never added before.
If the constructor specifying an ILcyLucyEnv
is used, the
ILcySimulatorModelFactory
will be removed as service from the Lucy back-end (see
ILcyLucyEnv.removeService(Object)
).
Note: it is only possible to remove ILcySimulatorModelFactory
instances which
were registered using the addSimulatorModelFactory(com.luciad.lucy.realtime.ILcySimulatorModelFactory)
method.
aSimulatorModelFactory
- The simulator model factory to remove. Must not be null
addSimulatorModelFactory(com.luciad.lucy.realtime.ILcySimulatorModelFactory)
public int getSimulatorModelFactoryCount()
ILcySimulatorModelFactory
instances.ILcySimulatorModelFactory
instances.public ILcySimulatorModelFactory getSimulatorModelFactory(int aIndex)
ILcySimulatorModelFactory
at index aIndex
.aIndex
- The index: 0 <= aIndex < getSimulatorModelFactoryCount()
ILcySimulatorModelFactory
at index aIndex
.public boolean canCreateSimulatorModel(ILcdModel aModel)
ILcySimulatorModelFactory
ILcySimulatorModelFactory
can create
a ILcdSimulatorModel
for the given ILcdModel
, false other wisecanCreateSimulatorModel
in interface ILcySimulatorModelFactory
aModel
- the ILcdModel
to considerILcdSimulatorModel
can be created, false otherwisepublic ILcdSimulatorModel createSimulatorModel(ILcdModel aModel)
ILcySimulatorModelFactory
ILcdSimulatorModel
for the given ILcdModel
.createSimulatorModel
in interface ILcySimulatorModelFactory
aModel
- The model to create a simulator model for.ILcdSimulatorModel