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 in BaseStream.
S - type of stream interface, as defined in BaseStream.
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 Details

    • BaseStreamWrapper

      protected BaseStreamWrapper(S source)
      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:
      isParallel in interface BaseStream<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 a try ... finally block.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface BaseStream<T,S extends BaseStream<T,S>>