Class Comment


  • public class Comment
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String _eol  
      private int _style  
      private java.lang.String _text  
      (package private) static int C_BLOCK  
      (package private) static int CPP_LINE  
      (package private) static int JAVA_DOC  
      (package private) static int UNKNOWN  
    • Constructor Summary

      Constructors 
      Constructor Description
      Comment()  
      Comment​(java.lang.String text)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void generate​(java.lang.String indent, java.io.PrintWriter printStream)
      Writes comment text to the specified print stream in the appropriate format.
      private void print​(java.lang.String indent, java.io.PrintWriter stream)
      Writes comment to the specified print stream without altering its format.
      private void printCBlock​(java.lang.String indent, java.io.PrintWriter stream)
      Writes comment in c-block-style to the specified print stream.
      private void printCppLine​(java.lang.String indent, java.io.PrintWriter stream)
      Writes a line comment to the specified print stream.
      private void printJavaDoc​(java.lang.String indent, java.io.PrintWriter stream)
      Writes comment in JavaDoc-style to the specified print stream.
      private int style​(java.lang.String text)
      Returns the comment style of a string.
      java.lang.String text()
      Returns comment text
      void text​(java.lang.String string)
      Sets comment text
      void write()
      Writes comment text to standard output (debug).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Comment

        Comment()
      • Comment

        Comment​(java.lang.String text)
    • Method Detail

      • text

        public void text​(java.lang.String string)
        Sets comment text
      • text

        public java.lang.String text()
        Returns comment text
        Returns:
        comment text
      • style

        private int style​(java.lang.String text)
        Returns the comment style of a string.
        Parameters:
        text - text to check the style of
        Returns:
        -1 =Unknown, 0 = Javadoc, 1 = Comment block, 2= Comment Line
      • write

        public void write()
        Writes comment text to standard output (debug).
      • generate

        public void generate​(java.lang.String indent,
                             java.io.PrintWriter printStream)
        Writes comment text to the specified print stream in the appropriate format.
        Parameters:
        indent - string to print at the start of each line. null is equivalent to an empty string.
        printStream - stream to write text to
      • print

        private void print​(java.lang.String indent,
                           java.io.PrintWriter stream)
        Writes comment to the specified print stream without altering its format. This routine does not alter vertical or horizontal spacing of comment text, thus, it only works well for comments with a non-indented first line.
      • printJavaDoc

        private void printJavaDoc​(java.lang.String indent,
                                  java.io.PrintWriter stream)
        Writes comment in JavaDoc-style to the specified print stream.
      • printCBlock

        private void printCBlock​(java.lang.String indent,
                                 java.io.PrintWriter stream)
        Writes comment in c-block-style to the specified print stream.
      • printCppLine

        private void printCppLine​(java.lang.String indent,
                                  java.io.PrintWriter stream)
        Writes a line comment to the specified print stream.