Class Comment

java.lang.Object
com.pnfsoftware.jeb.core.units.impl.Comment

@Ser public class Comment extends Object
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 Details

    • Comment

      public Comment()
      Create an empty comment.
    • Comment

      public Comment(String inline)
      Create an inline comment.
      Parameters:
      inline - inline comment text
    • Comment

      public Comment(String inline, String pre)
      Create a comment.
      Parameters:
      inline - inline comment text
      pre - pre-comment text
    • Comment

      public Comment(String inline, String pre, Collection<MetaComment> metacoll)
      Create a comment.
      Parameters:
      inline - inline comment text
      pre - pre-comment text
      metacoll - meta-comments
  • Method Details

    • setInline

      public void setInline(String inline)
      Set the inline comment text.
      Parameters:
      inline - inline comment text
    • getInline

      public String getInline()
      Retrieve the inline comment text.
      Returns:
      inline comment text, or null if none
    • setPre

      public void setPre(String pre)
      Set the pre-comment text.
      Parameters:
      pre - pre-comment text
    • getPre

      public String getPre()
      Retrieve the pre-comment text.
      Returns:
      pre-comment text, or null if none
    • getMetaComments

      public Collection<MetaComment> getMetaComments()
      Retrieve the meta-comments.
      Returns:
      meta-comments, possibly empty
    • getMetaComments

      public Collection<MetaComment> getMetaComments(int flagsMustHave, int flagsCantHave)
      Retrieve meta-comments filtered by flags.
      Parameters:
      flagsMustHave - mask of flags that must be present
      flagsCantHave - 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()
      Overrides:
      hashCode in class Object
    • equals

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

      public String formatRaw()
      Format the comment as raw text.
      Returns:
      raw formatted comment text
    • toString

      public String toString()
      Overrides:
      toString in class Object