org.netbeans.modules.java.source 0.80.1 17

org.netbeans.api.java.source
Class Comment

java.lang.Object
  extended by org.netbeans.api.java.source.Comment

public final class Comment
extends Object

An individual comment, consisting of a style, begin and end source file position, the indention (column) of its first character, and its text.

Since:
0.43

Nested Class Summary
static class Comment.Style
          The set of different comment types.
 
Method Summary
static Comment create(Comment.Style style, int pos, int endPos, int indent, String text)
          Define a comment, using source file positions.
static Comment create(Comment.Style style, String text)
          Define a comment, using specified style.
static Comment create(String s)
          Define a new block comment from a string.
 int endPos()
          The end position in the source file, or NOPOS if the comment was added by a translation operation.
 boolean equals(Object obj)
           
 String getText()
          Returns the comment text.
 int hashCode()
           
 int indent()
          Returns the line indention for this comment, or NOPOS if the comment was added by a translation operation.
 boolean isDocComment()
          Returns true if this is a JavaDoc comment.
 boolean isNew()
           
 int pos()
          The start position in the source file, or NOPOS if the comment was added by a translation operation.
 Comment.Style style()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static Comment create(String s)
Define a new block comment from a string. This comment does not have source file positions.

Parameters:
s - textual content of comment. With or without proper escaping
Returns:
new comment

create

public static Comment create(Comment.Style style,
                             int pos,
                             int endPos,
                             int indent,
                             String text)
Define a comment, using source file positions.

Parameters:
style - the style of comment
pos - start position within source file
endPos - end position within source file
indent - indentation of comment
text - textual content of comment. With or without proper escaping
Returns:
new comment

create

public static Comment create(Comment.Style style,
                             String text)
Define a comment, using specified style.

Parameters:
style - the style of comment
indent - indentation of comment
text - textual content of comment. With or without proper escaping
Returns:
new comment

style

public Comment.Style style()

pos

public int pos()
The start position in the source file, or NOPOS if the comment was added by a translation operation.


endPos

public int endPos()
The end position in the source file, or NOPOS if the comment was added by a translation operation.


indent

public int indent()
Returns the line indention for this comment, or NOPOS if the comment was added by a translation operation.


isDocComment

public boolean isDocComment()
Returns true if this is a JavaDoc comment.


getText

public String getText()
Returns the comment text.


isNew

public boolean isNew()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

org.netbeans.modules.java.source 0.80.1 17

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.