Class BaseStreamIterator

java.lang.Object
gorsat.Iterators.IteratorSource
gorsat.process.BaseStreamIterator
All Implemented Interfaces:
java.util.Iterator<java.lang.String>
Direct Known Subclasses:
GorStreamIterator, NorStreamIterator

public abstract class BaseStreamIterator
extends gorsat.Iterators.IteratorSource
Iterator that is based on stream coming from the Supplier provided. Supports reinitialization of the stream and iterator when setPosition is called.
  • Constructor Summary

    Constructors 
    Constructor Description
    BaseStreamIterator​(java.util.function.Supplier<java.util.stream.Stream<java.lang.String>> streamSupplier)  
  • Method Summary

    Modifier and Type Method Description
    void close()  
    java.lang.String getHeader()  
    boolean hasNext()  
    protected void initIteratorAndHeader()  
    java.lang.String next()  
    java.lang.String produceHeaderFromData()  
    void setPosition​(java.lang.String seekChr, int seekPos)  

    Methods inherited from class gorsat.Iterators.IteratorSource

    forEachRemaining, remove

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseStreamIterator

      public BaseStreamIterator​(java.util.function.Supplier<java.util.stream.Stream<java.lang.String>> streamSupplier)
  • Method Details

    • initIteratorAndHeader

      protected void initIteratorAndHeader()
    • produceHeaderFromData

      public java.lang.String produceHeaderFromData()
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<java.lang.String>
      Specified by:
      hasNext in class gorsat.Iterators.IteratorSource
    • next

      public java.lang.String next()
      Specified by:
      next in interface java.util.Iterator<java.lang.String>
      Specified by:
      next in class gorsat.Iterators.IteratorSource
    • setPosition

      public void setPosition​(java.lang.String seekChr, int seekPos)
      Specified by:
      setPosition in class gorsat.Iterators.IteratorSource
    • getHeader

      public java.lang.String getHeader()
      Specified by:
      getHeader in class gorsat.Iterators.IteratorSource
    • close

      public void close()
      Specified by:
      close in class gorsat.Iterators.IteratorSource