org.archiviststoolkit.swing
Class ProgressMonitorBufferedReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.BufferedReader
          extended by org.archiviststoolkit.swing.ProgressMonitorBufferedReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class ProgressMonitorBufferedReader
extends java.io.BufferedReader

Allows us to monitor progress on readers.


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
ProgressMonitorBufferedReader(java.awt.Component parent, java.lang.Object message, java.io.Reader reader)
          Create the monitor stream.
 
Method Summary
 void close()
          Close our stream and progress monitor.
 javax.swing.ProgressMonitor getProgressMonitor()
          Get the ProgressMonitor we are using.
 java.lang.String readLine()
          Read the next line of input.
 
Methods inherited from class java.io.BufferedReader
mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressMonitorBufferedReader

public ProgressMonitorBufferedReader(java.awt.Component parent,
                                     java.lang.Object message,
                                     java.io.Reader reader)
Create the monitor stream.

Parameters:
parent - The parent of the ProgressMonitor
message - The message for the Progress Monitor. Typically something like "Reading filename..."
reader - The input stream.
Method Detail

getProgressMonitor

public javax.swing.ProgressMonitor getProgressMonitor()
Get the ProgressMonitor we are using.

Returns:
the current monitor

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Read the next line of input.

Overrides:
readLine in class java.io.BufferedReader
Returns:
the next line in the stream.
Throws:
java.io.IOException - if something really goes wrong

close

public void close()
           throws java.io.IOException
Close our stream and progress monitor.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.BufferedReader
Throws:
java.io.IOException - if we cant close the underlying stream