Package com.luciad.lucy.io
Class TLcyCompositeInputStreamFactory
java.lang.Object
com.luciad.lucy.util.TLcyGenericComposite<ILcdInputStreamFactory>
com.luciad.lucy.io.TLcyCompositeInputStreamFactory
- All Implemented Interfaces:
ILcdInputStreamFactory
,Iterable<ILcdInputStreamFactory>
public class TLcyCompositeInputStreamFactory
extends TLcyGenericComposite<ILcdInputStreamFactory>
implements ILcdInputStreamFactory
Composite implementation (see composite design pattern) of ILcdInputStreamFactory
.
You can use the TLcyCompositeInputStreamFactory
in two ways:
- With
ILcyLucyEnv
:- When asked to create an inputstream, it loops over the
ILcdInputStreamFactory
services registered in the Lucy back-end until one succeeds. - Adding and removing
TLcyCompositeInputStreamFactory
s will add and remove the factory as a service in the Lucy back-end.
- When asked to create an inputstream, it loops over the
- Without
ILcyLucyEnv
:- When asked to create an inputstream, it loops over the
ILcdInputStreamFactory
registered in this instance until one succeeds. - Adding and removing
TLcyCompositeInputStreamFactory
s will only be performed on this instance.
- When asked to create an inputstream, it loops over the
You can also loop over the underlying ILcdInputStreamFactory
s yourself using the
standard iterator.
- Since:
- 10.1
- See Also:
-
Field Summary
Fields inherited from class com.luciad.lucy.util.TLcyGenericComposite
PRIORITY_DEFAULT, PRIORITY_FALLBACK
-
Constructor Summary
ConstructorDescriptionCreate a new empty composite factory that will act on factories registered in this instance only.TLcyCompositeInputStreamFactory
(ILcyLucyEnv aLucyEnv) Create a composite factory that will act on the factories registered in the Lucy back-end. -
Method Summary
Modifier and TypeMethodDescriptioncreateInputStream
(String aSource) Delegates to the first input stream factory whosecreateInputStream()
method does not throw an exception.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 com.luciad.io.ILcdInputStreamFactory
canCreateInputStream
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TLcyCompositeInputStreamFactory
public TLcyCompositeInputStreamFactory()Create a new empty composite factory that will act on factories registered in this instance only. -
TLcyCompositeInputStreamFactory
Create a composite factory that will act on the factories registered in the Lucy back-end.- Parameters:
aLucyEnv
- The Lucy back-end
-
-
Method Details
-
createInputStream
Delegates to the first input stream factory whosecreateInputStream()
method does not throw an exception.- Specified by:
createInputStream
in interfaceILcdInputStreamFactory
- Parameters:
aSource
- an accessible data source.- Returns:
- The InputStream created by the first factory that does not throw
IOException
. - Throws:
IOException
- If none of the availableILcdInputStreamFactory
instances could create an input stream.- See Also:
-