gov.nasa.pds.ltdt.label.statement
Class PrettyCommentStatement
java.lang.Object
gov.nasa.pds.tools.label.Statement
gov.nasa.pds.tools.label.CommentStatement
gov.nasa.pds.ltdt.label.statement.PrettyCommentStatement
- All Implemented Interfaces:
- PrettyStatement, java.lang.Comparable
public class PrettyCommentStatement
- extends gov.nasa.pds.tools.label.CommentStatement
- implements PrettyStatement
Class used to provide a string representation of a comment.
- Author:
- mcayanan
Fields inherited from class gov.nasa.pds.tools.label.CommentStatement |
COMMENT_ID |
Fields inherited from class gov.nasa.pds.tools.label.Statement |
context, filename, identifier, lineNumber |
Constructor Summary |
PrettyCommentStatement(int lineNumber,
java.lang.String identifier,
java.lang.String comment)
Constructs a CommentStatement. |
Method Summary |
java.lang.String |
toString()
Returns a string representation of the comment. |
java.lang.String |
toString(short indentLength)
Returns a string representation of the comment with a
given indentation. |
java.lang.String |
toString(short indentLength,
int equalsPosition)
Returns a string representation of the comment. |
Methods inherited from class gov.nasa.pds.tools.label.CommentStatement |
attachComment, getComment, setComment |
Methods inherited from class gov.nasa.pds.tools.label.Statement |
compareTo, getContext, getFilename, getIdentifier, getLineNumber, setContext, setFilename |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PrettyCommentStatement
public PrettyCommentStatement(int lineNumber,
java.lang.String identifier,
java.lang.String comment)
- Constructs a CommentStatement.
- Parameters:
lineNumber
- Where the statement is located.identifier
- The data element name associated with the comment.comment
- The comment string.
toString
public java.lang.String toString()
- Returns a string representation of the comment.
- Specified by:
toString
in interface PrettyStatement
- Overrides:
toString
in class java.lang.Object
toString
public java.lang.String toString(short indentLength)
- Returns a string representation of the comment with a
given indentation.
- Specified by:
toString
in interface PrettyStatement
- Parameters:
indentLength
- The number of spaces to indent the statement.
toString
public java.lang.String toString(short indentLength,
int equalsPosition)
- Returns a string representation of the comment. The equals
position should always be set to zero since comments don't have equals.
- Specified by:
toString
in interface PrettyStatement
- Parameters:
indentLength
- The number of spaces to indent the statement.equalsPosition
- The position of the '='.
- Throws:
java.lang.IllegalArgumentException
- If the equalsPosition variable is set
to a number other than zero.
Copyright © 2005-2008 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.