Class Comment
java.lang.Object
com.pnfsoftware.jeb.core.units.impl.Comment
Comments are managed by
comment managers. A comment can consist
of: a primary inline string; a secondary top string; a collection of meta comments (pairs of
object/flag). Comments are not immutable, but should not be attempted to be modified directly.
Modifications are to be done by a comment manager.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanFormat the comment as raw text.Retrieve the inline comment text.Retrieve the meta-comments.getMetaComments(int flagsMustHave, int flagsCantHave) Retrieve meta-comments filtered by flags.getPre()Retrieve the pre-comment text.inthashCode()booleanisEmpty()Determine whether this comment contains no text or meta-comments.voidSet the inline comment text.voidSet the pre-comment text.toString()
-
Constructor Details
-
Comment
public Comment()Create an empty comment. -
Comment
Create an inline comment.- Parameters:
inline- inline comment text
-
Comment
Create a comment.- Parameters:
inline- inline comment textpre- pre-comment text
-
Comment
Create a comment.- Parameters:
inline- inline comment textpre- pre-comment textmetacoll- meta-comments
-
-
Method Details
-
setInline
Set the inline comment text.- Parameters:
inline- inline comment text
-
getInline
Retrieve the inline comment text.- Returns:
- inline comment text, or null if none
-
setPre
Set the pre-comment text.- Parameters:
pre- pre-comment text
-
getPre
Retrieve the pre-comment text.- Returns:
- pre-comment text, or null if none
-
getMetaComments
Retrieve the meta-comments.- Returns:
- meta-comments, possibly empty
-
getMetaComments
Retrieve meta-comments filtered by flags.- Parameters:
flagsMustHave- mask of flags that must be presentflagsCantHave- mask of flags that must be absent- Returns:
- filtered meta-comments, possibly empty
-
isEmpty
public boolean isEmpty()Determine whether this comment contains no text or meta-comments.- Returns:
- true if empty
-
hashCode
public int hashCode() -
equals
-
formatRaw
Format the comment as raw text.- Returns:
- raw formatted comment text
-
toString
-