All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sdsu.io.CommentParser

java.lang.Object
   |
   +----sdsu.io.CommentParser

public class CommentParser
extends Object
Parses two types of comments: normal and data. A normal comment starts with a comment character on a new line. (Actually a comment in indicated when the first non-whitespace character on a new line is the comment char.) A data comment is a comment with the special comment character occuring immediatley after the comment character in a comment and the text in the comment is formated in name-value pairs. These pairs can be used to create a LabeledData object.

Version:
1.0 12 June 1998
Author:
Roger Whitney (whitney@cs.sdsu.edu)

Constructor Index

 o CommentParser(PushbackReader, char, char)
 o CommentParser(PushbackReader, char, char, String)

Method Index

 o readAll()
Returns rest of the input in a string
 o readComment()
Returns comment from the input If input does not start with a comment return a string of length zero
 o readDataComment()
Returns special comment from the input If input does not start with a special comment return a string of length zero
 o removeWhiteSpace()
Insures that the input stream starts with non-whitespace char

Constructors

 o CommentParser
 public CommentParser(PushbackReader input,
                      char commentChar,
                      char specialCommentChar)
 o CommentParser
 public CommentParser(PushbackReader input,
                      char commentChar,
                      char specialCommentChar,
                      String whiteSpace)

Methods

 o removeWhiteSpace
 public void removeWhiteSpace() throws IOException
Insures that the input stream starts with non-whitespace char

 o readAll
 public String readAll() throws IOException
Returns rest of the input in a string

 o readComment
 public String readComment() throws IOException
Returns comment from the input If input does not start with a comment return a string of length zero

 o readDataComment
 public LabeledData readDataComment() throws IOException
Returns special comment from the input If input does not start with a special comment return a string of length zero


All Packages  Class Hierarchy  This Package  Previous  Next  Index