/[classpath]/classpath/java/io/PrintWriter.java
ViewVC logotype

Diff of /classpath/java/io/PrintWriter.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by mark, Sat Jul 2 20:32:38 2005 UTC revision 1.16 by tromey, Mon Aug 22 18:50:11 2005 UTC
# Line 1  Line 1 
1  /* PrintWriter.java -- prints primitive values and objects to a stream as text  /* PrintWriter.java -- prints primitive values and objects to a stream as text
2     Copyright (C) 1998, 1999, 2000, 2001  Free Software Foundation     Copyright (C) 1998, 1999, 2000, 2001, 2005  Free Software Foundation
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 72  public class PrintWriter extends Writer Line 72  public class PrintWriter extends Writer
72    private boolean error;    private boolean error;
73    
74    /**    /**
75       * Set to true if close() has been called on this PrintWriter.
76       */
77      private boolean closed;
78    
79      /**
80     * This is the underlying <code>Writer</code> we are sending output     * This is the underlying <code>Writer</code> we are sending output
81     * to     * to
82     */     */
# Line 148  public class PrintWriter extends Writer Line 153  public class PrintWriter extends Writer
153    }    }
154    
155    /**    /**
156     * This method checks to see if an error has occurred on this stream.  Note     * This method checks to see if an error has occurred on this
157     * that once an error has occurred, this method will continue to report     * stream.  Note that once an error has occurred, this method will
158     * <code>true</code> forever for this stream.  Before checking for an     * continue to report <code>true</code> forever for this stream.  If
159     * error condition, this method flushes the stream.     * the stream has not been closed, then before checking for an error
160       * condition, this method flushes the stream.
161     *     *
162     * @return <code>true</code> if an error has occurred,     * @return <code>true</code> if an error has occurred,
163     * <code>false</code> otherwise     * <code>false</code> otherwise
164     */     */
165    public boolean checkError()    public boolean checkError()
166    {    {
167      flush();      if (! closed)
168          flush();
169      return error;      return error;
170    }    }
171    
# Line 191  public class PrintWriter extends Writer Line 198  public class PrintWriter extends Writer
198        {        {
199          error = true;          error = true;
200        }        }
201        closed = true;
202    }    }
203    
204    /**    /**

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26