gov.llnl.babel.symbols

Class Comment


public class Comment
extends ASTNode

The Comment class represents a documentation comment. The comment is stored as an array of strings, with each array element representing one line of the comment.

Field Summary

Fields inherited from class gov.llnl.babel.symbols.ASTNode

d_frozen

Constructor Summary

Comment(String[] comment)
This constructor for the Comment class takes an array of strings, one string for each line of the comment.

Method Summary

static Comment
combineComments(Comment original, Comment additional)
boolean
equals(Object o)
Return true if two comments are exactly equal.
String[]
getComment()
Return the comment as an array of strings, with one string for each line of the comment.
int
hashCode()
boolean
isEmpty()
Return true if the comment is empty (i.e., no lines); otherwise, return false.

Methods inherited from class gov.llnl.babel.symbols.ASTNode

checkFrozen, clone, freeze, protectCollection, protectList, protectMap, protectSet

Constructor Details

Comment

public Comment(String[] comment)
This constructor for the Comment class takes an array of strings, one string for each line of the comment. The input argument may be null, which indicates "no comment."

Method Details

combineComments

public static Comment combineComments(Comment original,
                                      Comment additional)

equals

public boolean equals(Object o)
Return true if two comments are exactly equal. Two comments are equal if they have the same number of lines, and each corresponding line is equal. This is false if the parameter is not a comment.
Parameters:
o - the object to test

getComment

public String[] getComment()
Return the comment as an array of strings, with one string for each line of the comment. The return argument may be null, in which case there is no comment text.

hashCode

public int hashCode()

isEmpty

public boolean isEmpty()
Return true if the comment is empty (i.e., no lines); otherwise, return false.