Class AbstractReaderSource

    • Method Detail

      • canReopenSource

        public boolean canReopenSource()
        Returns true if the source can be restarted (ie. if getReader() will return non-null on subsequent calls.
        Specified by:
        canReopenSource in interface ReaderSource
        Returns:
        true if the resource can be reopened for reading
      • getLine

        public String getLine​(int lineNumber,
                              Janitor janitor)
        Returns a line from the source, or null, if unavailable. If you supply a Janitor, resources will be cached.
        Specified by:
        getLine in interface ReaderSource
        Parameters:
        lineNumber - the number of the line of interest
        janitor - helper to clean up afterwards
        Returns:
        the line of interest
      • cleanup

        public void cleanup()
        Cleans up any cached resources used by getLine().
        Specified by:
        cleanup in interface HasCleanup
        Specified by:
        cleanup in interface ReaderSource