Package org.apache.sis.internal.stream
Class BaseStreamWrapper<T,S extends BaseStream<T,S>>
java.lang.Object
org.apache.sis.internal.stream.BaseStreamWrapper<T,S>
- Type Parameters:
T- type of values contained in the stream, as defined inBaseStream.S- type of stream interface, as defined inBaseStream.
- All Implemented Interfaces:
AutoCloseable,BaseStream<T,S>
- Direct Known Subclasses:
DoubleStreamWrapper,StreamWrapper
public abstract class BaseStreamWrapper<T,S extends BaseStream<T,S>>
extends Object
implements BaseStream<T,S>
Base class of all stream wrappers defined in this package.
- Since:
- 1.1
- Version:
- 1.1
- Author:
- Alexis Manin (Geomatys), Martin Desruisseaux (Geomatys)
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseStreamWrapper(S source) Creates a new wrapper for the given stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this stream.booleanReturns whether stream terminal operation would execute in parallel.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.stream.BaseStream
iterator, onClose, parallel, sequential, spliterator, unordered
-
Constructor Details
-
BaseStreamWrapper
Creates a new wrapper for the given stream.- Parameters:
source- the stream to wrap.
-
-
Method Details
-
isParallel
public boolean isParallel()Returns whether stream terminal operation would execute in parallel.- Specified by:
isParallelin interfaceBaseStream<T,S extends BaseStream<T, S>> - Returns:
- whether this stream works in parallel.
-
close
public void close()Closes this stream. This method can be invoked on this stream even if it is not anymore the active one because this is the stream referenced in atry ... finallyblock.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBaseStream<T,S extends BaseStream<T, S>>
-