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
ConstructorsConstructorDescriptionDeprecated.Default constructor.Deprecated.Construct aTLcyCompositeSimulatorModelFactoryworking on the Lucy back-end -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSimulatorModelFactory(ILcySimulatorModelFactory aSimulatorModelFactory) Deprecated.Adds the givenILcySimulatorModelFactoryto the list of registered simulator model factories.booleancanCreateSimulatorModel(ILcdModel aModel) Deprecated.This method shall return true if thisILcySimulatorModelFactorycan create aILcdSimulatorModelfor the givenILcdModel, false other wisecreateSimulatorModel(ILcdModel aModel) Deprecated.Creates aILcdSimulatorModelfor the givenILcdModel.getSimulatorModelFactory(int aIndex) Deprecated.Returns theILcySimulatorModelFactoryat indexaIndex.intDeprecated.Returns the number of registeredILcySimulatorModelFactoryinstances.voidremoveSimulatorModelFactory(ILcySimulatorModelFactory aSimulatorModelFactory) Deprecated.Removes the givenILcySimulatorModelFactoryfrom the list of registered simulator model factories.Methods inherited from class com.luciad.lucy.util.TLcyGenericComposite
add, add, getList, 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
-
TLcyCompositeSimulatorModelFactory
public TLcyCompositeSimulatorModelFactory()Deprecated.Default constructor.
The created instance will only work on the
ILcySimulatorModelFactoryinstances registered to it. If you want to use all registeredILcySimulatorModelFactoryinstances of the Lucy back-end, useTLcyCompositeSimulatorModelFactory(com.luciad.lucy.ILcyLucyEnv)instead.- See Also:
-
TLcyCompositeSimulatorModelFactory
Deprecated.Construct a
TLcyCompositeSimulatorModelFactoryworking on the Lucy back-endIt will use all
ILcySimulatorModelFactoryinstances registered to the back-end, and adding and/or removingILcySimulatorModelFactorys to/from thisTLcyCompositeSimulatorModelFactorywill respectively add/remove it as service from the back-end.If you want to create a
TLcyCompositeSimulatorModelFactorywhich does not use the back-end, useTLcyCompositeSimulatorModelFactory()instead.- Parameters:
aLucyEnv- The Lucy back-end.- See Also:
-
-
Method Details
-
addSimulatorModelFactory
Deprecated.Adds the given
ILcySimulatorModelFactoryto the list of registered simulator model factories.If the constructor specifying an
ILcyLucyEnvis used, theILcySimulatorModelFactorywill be registered as a service on the Lucy back-end (seeILcyLucyEnv.addService(Object, int)). When callingILcyLucyEnv.getServices(Class)afterwards,aSimulatorModelFactorywill only be included in the returned list when the requested class wasILcySimulatorModelFactory.class.
Note: if you want to remove the registeredILcySimulatorModelFactoryafterwards, 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
ILcySimulatorModelFactoryfrom the list of registered simulator model factories. Nothing will happen if the given factory was never added before.If the constructor specifying an
ILcyLucyEnvis used, theILcySimulatorModelFactorywill be removed as service from the Lucy back-end (seeILcyLucyEnv.removeService(Object)).
Note: it is only possible to removeILcySimulatorModelFactoryinstances 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 registeredILcySimulatorModelFactoryinstances.- Returns:
- the number of registered
ILcySimulatorModelFactoryinstances.
-
getSimulatorModelFactory
Deprecated.Returns theILcySimulatorModelFactoryat indexaIndex.- Parameters:
aIndex- The index: 0 <= aIndex <getSimulatorModelFactoryCount()- Returns:
- the
ILcySimulatorModelFactoryat indexaIndex.
-
canCreateSimulatorModel
Deprecated.Description copied from interface:ILcySimulatorModelFactoryThis method shall return true if thisILcySimulatorModelFactorycan create aILcdSimulatorModelfor the givenILcdModel, false other wise- Specified by:
canCreateSimulatorModelin interfaceILcySimulatorModelFactory- Parameters:
aModel- theILcdModelto consider- Returns:
- true if a
ILcdSimulatorModelcan be created, false otherwise
-
createSimulatorModel
Deprecated.Description copied from interface:ILcySimulatorModelFactoryCreates aILcdSimulatorModelfor the givenILcdModel.- Specified by:
createSimulatorModelin interfaceILcySimulatorModelFactory- Parameters:
aModel- The model to create a simulator model for.- Returns:
- The newly created
ILcdSimulatorModel
-
ILcySimulatorModelFactory