Class LineComment

All Implemented Interfaces:
NodeWithRange<Node>, NodeWithTokenRange<Node>, Observable, Visitable, HasParentNode<Node>, Cloneable

public class LineComment extends Comment

AST node that represent line comments.

Line comments start with "//" and finish at the end of the line ("\n").
Author:
Julio Vilmar Gesser
  • Constructor Details

    • LineComment

      public LineComment()
    • LineComment

      public LineComment(String content)
    • LineComment

      public LineComment(TokenRange tokenRange, String content)
      This constructor is used by the parser and is considered private.
  • Method Details

    • accept

      public <R,​ A> R accept(GenericVisitor<R,​A> v, A arg)
      Description copied from interface: Visitable
      Accept method for visitor support.
      Type Parameters:
      R - the type of the return value of the visitor
      A - the type the user argument passed to the visitor
      Parameters:
      v - the visitor implementation
      arg - the argument passed to the visitor (of type A)
      Returns:
      the result of the visit (of type R)
    • accept

      public <A> void accept(VoidVisitor<A> v, A arg)
      Description copied from interface: Visitable
      Accept method for visitor support.
      Type Parameters:
      A - the type the argument passed for the visitor
      Parameters:
      v - the visitor implementation
      arg - any value relevant for the visitor (of type A)
    • isLineComment

      public boolean isLineComment()
      Overrides:
      isLineComment in class Comment
    • clone

      public LineComment clone()
      Overrides:
      clone in class Comment
    • getMetaModel

      public LineCommentMetaModel getMetaModel()
      Overrides:
      getMetaModel in class Comment
      Returns:
      get JavaParser specific node introspection information.
    • asLineComment

      public LineComment asLineComment()
      Overrides:
      asLineComment in class Comment
    • ifLineComment

      public void ifLineComment(Consumer<LineComment> action)
      Overrides:
      ifLineComment in class Comment
    • toLineComment

      public Optional<LineComment> toLineComment()
      Overrides:
      toLineComment in class Comment