org.eclipse.mylar.internal.tasks.ui.util
Class SubstitutionTextReader

java.lang.Object
  extended by java.io.Reader
      extended by org.eclipse.mylar.internal.tasks.ui.util.SingleCharReader
          extended by org.eclipse.mylar.internal.tasks.ui.util.SubstitutionTextReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable
Direct Known Subclasses:
HTML2TextReader

public abstract class SubstitutionTextReader
extends SingleCharReader

COPY OF: org.eclipse.jface.internal.text.html.HTML2TextReader


Field Summary
private  java.lang.StringBuffer fBuffer
           
private  int fCharAfterWhiteSpace
           
private  int fIndex
           
private  java.io.Reader fReader
           
private  boolean fReadFromBuffer
           
private  boolean fSkipWhiteSpace
          Tells whether white space characters are skipped.
protected  boolean fWasWhiteSpace
           
protected static java.lang.String LINE_DELIM
           
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
protected SubstitutionTextReader(java.io.Reader reader)
           
 
Method Summary
 void close()
           
protected abstract  java.lang.String computeSubstitution(int c)
          Computes the substitution for the given character and if necessary subsequent characters.
protected  java.io.Reader getReader()
          Returns the internal reader.
protected  boolean isSkippingWhitespace()
           
protected  int nextChar()
          Returns the next character.
 int read()
           
 boolean ready()
           
 void reset()
           
protected  void setSkipWhitespace(boolean state)
           
 
Methods inherited from class org.eclipse.mylar.internal.tasks.ui.util.SingleCharReader
getString, read
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_DELIM

protected static final java.lang.String LINE_DELIM

fReader

private java.io.Reader fReader

fWasWhiteSpace

protected boolean fWasWhiteSpace

fCharAfterWhiteSpace

private int fCharAfterWhiteSpace

fSkipWhiteSpace

private boolean fSkipWhiteSpace
Tells whether white space characters are skipped.


fReadFromBuffer

private boolean fReadFromBuffer

fBuffer

private java.lang.StringBuffer fBuffer

fIndex

private int fIndex
Constructor Detail

SubstitutionTextReader

protected SubstitutionTextReader(java.io.Reader reader)
Method Detail

computeSubstitution

protected abstract java.lang.String computeSubstitution(int c)
                                                 throws java.io.IOException
Computes the substitution for the given character and if necessary subsequent characters. Implementation should use nextChar to read subsequent characters.

Parameters:
c - the character to be substituted
Returns:
the substitution for c
Throws:
java.io.IOException - in case computing the substitution fails

getReader

protected java.io.Reader getReader()
Returns the internal reader.

Returns:
the internal reader

nextChar

protected int nextChar()
                throws java.io.IOException
Returns the next character.

Returns:
the next character
Throws:
java.io.IOException - in case reading the character fails

read

public int read()
         throws java.io.IOException
Specified by:
read in class SingleCharReader
Throws:
java.io.IOException
See Also:
Reader.read()

ready

public boolean ready()
              throws java.io.IOException
Overrides:
ready in class SingleCharReader
Throws:
java.io.IOException
See Also:
Reader.ready()

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Reader
Throws:
java.io.IOException
See Also:
Reader.close()

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class java.io.Reader
Throws:
java.io.IOException
See Also:
Reader.reset()

setSkipWhitespace

protected final void setSkipWhitespace(boolean state)

isSkippingWhitespace

protected final boolean isSkippingWhitespace()