Class TLcyCompositeSimulatorModelFactory
- All Implemented Interfaces:
ILcySimulatorModelFactory
,Iterable<ILcySimulatorModelFactory>
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;
- Since:
- 10.0
-
Field Summary
Fields inherited from class com.luciad.lucy.util.TLcyGenericComposite
PRIORITY_DEFAULT, PRIORITY_FALLBACK
-
Constructor Summary
ConstructorDescriptionDeprecated.Default constructor.Deprecated.Construct aTLcyCompositeSimulatorModelFactory
working on the Lucy back-end -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSimulatorModelFactory
(ILcySimulatorModelFactory aSimulatorModelFactory) Deprecated.Adds the givenILcySimulatorModelFactory
to the list of registered simulator model factories.boolean
canCreateSimulatorModel
(ILcdModel aModel) Deprecated.This method shall return true if thisILcySimulatorModelFactory
can create aILcdSimulatorModel
for the givenILcdModel
, false other wisecreateSimulatorModel
(ILcdModel aModel) Deprecated.Creates aILcdSimulatorModel
for the givenILcdModel
.getSimulatorModelFactory
(int aIndex) Deprecated.Returns theILcySimulatorModelFactory
at indexaIndex
.int
Deprecated.Returns the number of registeredILcySimulatorModelFactory
instances.void
removeSimulatorModelFactory
(ILcySimulatorModelFactory aSimulatorModelFactory) Deprecated.Removes the givenILcySimulatorModelFactory
from the list of registered simulator model factories.Methods inherited from class com.luciad.lucy.util.TLcyGenericComposite
add, add, getList, 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
-
TLcyCompositeSimulatorModelFactory
public TLcyCompositeSimulatorModelFactory()Deprecated.Default constructor.
The created instance will only work on the
ILcySimulatorModelFactory
instances registered to it. If you want to use all registeredILcySimulatorModelFactory
instances of the Lucy back-end, useTLcyCompositeSimulatorModelFactory(com.luciad.lucy.ILcyLucyEnv)
instead.- See Also:
-
TLcyCompositeSimulatorModelFactory
Deprecated.Construct a
TLcyCompositeSimulatorModelFactory
working on the Lucy back-endIt will use all
ILcySimulatorModelFactory
instances registered to the back-end, and adding and/or removingILcySimulatorModelFactory
s to/from thisTLcyCompositeSimulatorModelFactory
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, useTLcyCompositeSimulatorModelFactory()
instead.- Parameters:
aLucyEnv
- The Lucy back-end.- See Also:
-
-
Method Details
-
addSimulatorModelFactory
Deprecated.Adds the given
ILcySimulatorModelFactory
to the list of registered simulator model factories.If the constructor specifying an
ILcyLucyEnv
is used, theILcySimulatorModelFactory
will be registered as a service on the Lucy back-end (seeILcyLucyEnv.addService(Object, int)
). When callingILcyLucyEnv.getServices(Class)
afterwards,aSimulatorModelFactory
will only be included in the returned list when the requested class wasILcySimulatorModelFactory.class
.
Note: if you want to remove the registeredILcySimulatorModelFactory
afterwards, useremoveSimulatorModelFactory(com.luciad.lucy.realtime.ILcySimulatorModelFactory)
and notILcyLucyEnv.removeService(Object)
.- Parameters:
aSimulatorModelFactory
- The simulator model factory to add. Must not benull
.- See Also:
-
removeSimulatorModelFactory
Deprecated.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, theILcySimulatorModelFactory
will be removed as service from the Lucy back-end (seeILcyLucyEnv.removeService(Object)
).
Note: it is only possible to removeILcySimulatorModelFactory
instances which were registered using theaddSimulatorModelFactory(com.luciad.lucy.realtime.ILcySimulatorModelFactory)
method.- Parameters:
aSimulatorModelFactory
- The simulator model factory to remove. Must not benull
- See Also:
-
getSimulatorModelFactoryCount
public int getSimulatorModelFactoryCount()Deprecated.Returns the number of registeredILcySimulatorModelFactory
instances.- Returns:
- the number of registered
ILcySimulatorModelFactory
instances.
-
getSimulatorModelFactory
Deprecated.Returns theILcySimulatorModelFactory
at indexaIndex
.- Parameters:
aIndex
- The index: 0 <= aIndex <getSimulatorModelFactoryCount()
- Returns:
- the
ILcySimulatorModelFactory
at indexaIndex
.
-
canCreateSimulatorModel
Deprecated.Description copied from interface:ILcySimulatorModelFactory
This method shall return true if thisILcySimulatorModelFactory
can create aILcdSimulatorModel
for the givenILcdModel
, false other wise- Specified by:
canCreateSimulatorModel
in interfaceILcySimulatorModelFactory
- Parameters:
aModel
- theILcdModel
to consider- Returns:
- true if a
ILcdSimulatorModel
can be created, false otherwise
-
createSimulatorModel
Deprecated.Description copied from interface:ILcySimulatorModelFactory
Creates aILcdSimulatorModel
for the givenILcdModel
.- Specified by:
createSimulatorModel
in interfaceILcySimulatorModelFactory
- Parameters:
aModel
- The model to create a simulator model for.- Returns:
- The newly created
ILcdSimulatorModel
-
ILcySimulatorModelFactory