org.aspectj.org.eclipse.jdt.internal.formatter.comment
Class SingleCommentLine

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.formatter.comment.CommentLine
      extended by org.aspectj.org.eclipse.jdt.internal.formatter.comment.SingleCommentLine
All Implemented Interfaces:
IBorderAttributes

public class SingleCommentLine
extends CommentLine

Single-line comment line in a comment region.

Since:
3.0

Field Summary
static java.lang.String SINGLE_COMMENT_PREFIX
          Line prefix for single line comments
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.formatter.comment.CommentLine
NON_FORMAT_START_PREFIX
 
Fields inherited from interface org.aspectj.org.eclipse.jdt.internal.formatter.comment.IBorderAttributes
BORDER_LOWER, BORDER_UPPER
 
Constructor Summary
protected SingleCommentLine(CommentRegion region)
          Creates a new single-line comment line.
 
Method Summary
protected  void adapt(CommentLine previous)
          Adapts the line attributes from the previous line in the comment region.
protected  void formatLowerBorder(CommentRange range, java.lang.String indentation, int length)
          Formats this comment line as end line having a lower border consisting of content line prefixes.
protected  void formatUpperBorder(CommentRange range, java.lang.String indentation, int length)
          Formats this comment line as start line having an upper border consisting of content line prefixes.
protected  java.lang.String getContentPrefix()
          Returns the line prefix of content lines.
protected  java.lang.String getEndingPrefix()
          Returns the line prefix of end lines.
protected  java.lang.String getStartingPrefix()
          Returns the line prefix of start lines.
protected  void scanLine(int line)
          Scans this comment line for comment range boundaries.
protected  void tokenizeLine(int line)
          Tokenizes this comment line into comment ranges
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.formatter.comment.CommentLine
append, formatLine, getFirst, getIndentationReference, getLast, getParent, getSize, hasAttribute, setAttribute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SINGLE_COMMENT_PREFIX

public static final java.lang.String SINGLE_COMMENT_PREFIX
Line prefix for single line comments

See Also:
Constant Field Values
Constructor Detail

SingleCommentLine

protected SingleCommentLine(CommentRegion region)
Creates a new single-line comment line.

Parameters:
region - comment region to create the line for
Method Detail

adapt

protected void adapt(CommentLine previous)
Description copied from class: CommentLine
Adapts the line attributes from the previous line in the comment region.

Specified by:
adapt in class CommentLine
Parameters:
previous - the previous comment line in the comment region

formatLowerBorder

protected void formatLowerBorder(CommentRange range,
                                 java.lang.String indentation,
                                 int length)
Description copied from class: CommentLine
Formats this comment line as end line having a lower border consisting of content line prefixes.

Overrides:
formatLowerBorder in class CommentLine
Parameters:
range - last comment range of the last comment line in the comment region
indentation - the indentation of the comment region
length - the maximal length of text in this comment region measured in average character widths

formatUpperBorder

protected void formatUpperBorder(CommentRange range,
                                 java.lang.String indentation,
                                 int length)
Description copied from class: CommentLine
Formats this comment line as start line having an upper border consisting of content line prefixes.

Overrides:
formatUpperBorder in class CommentLine
Parameters:
range - the first comment range in the comment region
indentation - the indentation of the comment region
length - the maximal length of text in this comment region measured in average character widths

getContentPrefix

protected java.lang.String getContentPrefix()
Description copied from class: CommentLine
Returns the line prefix of content lines.

Specified by:
getContentPrefix in class CommentLine
Returns:
line prefix of content lines

getEndingPrefix

protected java.lang.String getEndingPrefix()
Description copied from class: CommentLine
Returns the line prefix of end lines.

Specified by:
getEndingPrefix in class CommentLine
Returns:
line prefix of end lines

getStartingPrefix

protected java.lang.String getStartingPrefix()
Description copied from class: CommentLine
Returns the line prefix of start lines.

Specified by:
getStartingPrefix in class CommentLine
Returns:
line prefix of start lines

scanLine

protected void scanLine(int line)
Description copied from class: CommentLine
Scans this comment line for comment range boundaries.

Specified by:
scanLine in class CommentLine
Parameters:
line - the index of this line in the comment region

tokenizeLine

protected void tokenizeLine(int line)
Description copied from class: CommentLine
Tokenizes this comment line into comment ranges

Overrides:
tokenizeLine in class CommentLine
Parameters:
line - the index of this line in the comment region