Class CircularListInput<T>

  • All Implemented Interfaces:
    Input<T>, java.io.Closeable, java.lang.AutoCloseable

    public class CircularListInput<T>
    extends ListInput<T>
    An list which may use fixed count of the items for unlimited (circular) retrieving.
    • Field Summary

      • Fields inherited from interface com.github.akurilov.commons.io.Input

        DELIMITER
    • Constructor Summary

      Constructors 
      Constructor Description
      CircularListInput​(java.util.List<T> dataItems)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()
      Get next item
      int get​(java.util.List<T> buffer, int maxCount)
      Bulk get into the specified buffer
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CircularListInput

        public CircularListInput​(java.util.List<T> dataItems)
        Parameters:
        dataItems - the source items collection
    • Method Detail

      • get

        public T get()
              throws java.io.IOException
        Description copied from interface: Input
        Get next item
        Specified by:
        get in interface Input<T>
        Overrides:
        get in class ListInput<T>
        Returns:
        next item
        Throws:
        java.io.EOFException - if no item available more
        java.io.IOException - if failed to get some-why
      • get

        public int get​(java.util.List<T> buffer,
                       int maxCount)
                throws java.io.EOFException,
                       java.io.IOException
        Description copied from class: ListInput
        Bulk get into the specified buffer
        Specified by:
        get in interface Input<T>
        Overrides:
        get in class ListInput<T>
        Parameters:
        buffer - buffer for the items
        maxCount - the count limit
        Returns:
        the actual count of the items got in the buffer
        Throws:
        java.io.EOFException - doesn't throw
        java.io.IOException - if failed to get some-why
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class ListInput<T>