org.codehaus.groovy.control.io
Interface ReaderSource

All Superinterfaces:
HasCleanup
All Known Implementing Classes:
AbstractReaderSource

public interface ReaderSource
extends HasCleanup

An interface for things that can supply (and resupply) a Reader on a source stream.

Version:
$Id: ReaderSource.java,v 1.1 2004/04/19 07:29:44 cpoirier Exp $
Author:
Chris Poirier

Method Summary
 boolean canReopenSource()
          Returns true if the source can be restarted (ie.
 void cleanup()
          Cleans up any cached resources used by getLine().
 String getLine(int lineNumber, Janitor janitor)
          Returns a line from the source, or null, if unavailable.
 Reader getReader()
          Returns a new Reader on the underlying source object.
 

Method Detail

getReader

public Reader getReader()
                 throws IOException
Returns a new Reader on the underlying source object. Returns null if the source can't be reopened.

Throws:
IOException

canReopenSource

public boolean canReopenSource()
Returns true if the source can be restarted (ie. if getReader() will return non-null on subsequent calls.


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.


cleanup

public void cleanup()
Cleans up any cached resources used by getLine().

Specified by:
cleanup in interface HasCleanup


Copyright © 2003-2004 The Codehaus. All Rights Reserved.