Package com.sun.javatest.finder
Class CommentStream
java.lang.Object
com.sun.javatest.finder.CommentStream
- Direct Known Subclasses:
HTMLCommentStream
,JavaCommentStream
,ShScriptCommentStream
This class extract all ASCII characters within a block comments. Any
leading spaces or comment-like characters are removed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BufferedReader
The reader from which to read comments.protected boolean
A flag indicating whether comments should be read in "fast scan" mode or not. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this CommentStream.void
init
(BufferedReader br) Initialize a CommentStream.abstract String
Read the next comment from the input reader.void
setFastScan
(boolean b) Set this comment stream into "fast scan" mode.
-
Field Details
-
cs
The reader from which to read comments. -
fastScan
protected boolean fastScanA flag indicating whether comments should be read in "fast scan" mode or not.
-
-
Constructor Details
-
CommentStream
public CommentStream()
-
-
Method Details
-
init
Initialize a CommentStream.- Parameters:
br
- The reader from which to read.
-
close
Close this CommentStream.- Throws:
IOException
- if there is a problem closing the stream.
-
setFastScan
public void setFastScan(boolean b) Set this comment stream into "fast scan" mode. Depending on the context, this should be set if there is a constraint that limits the set of comments that might be of interest.- Parameters:
b
- Set to true to enable a fast scan for comments.
-
readComment
Read the next comment from the input reader.- Returns:
- The next comment that is read from the stream.
- Throws:
IOException
- if there is a problem while reading the next comment.
-