View Javadoc

1   // Copyright 2006-2007, by the California Institute of Technology.
2   // ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.
3   // Any commercial use must be negotiated with the Office of Technology Transfer
4   // at the California Institute of Technology.
5   //
6   // This software is subject to U. S. export control laws and regulations
7   // (22 C.F.R. 120-130 and 15 C.F.R. 730-774). To the extent that the software
8   // is subject to U.S. export control laws and regulations, the recipient has
9   // the responsibility to obtain export licenses or other export authority as
10  // may be required before exporting such information to foreign countries or
11  // providing access to foreign nationals.
12  //
13  // $Id: CommentStatement.java 2606 2007-04-18 19:35:09Z pramirez $ 
14  //
15  
16  package gov.nasa.pds.tools.label;
17  
18  /***
19   * @author pramirez
20   * @version $Revision: 2606 $
21   * 
22   */
23  public class CommentStatement extends Statement {
24      public final static String COMMENT_ID = "COMMENT-";
25      private String comment;
26  
27      public CommentStatement(int lineNumber, String identifier, String comment) {
28          super(lineNumber, identifier);
29          this.comment = comment;
30      }
31      
32      /***
33       * @param lineNumber
34       * @param identifier
35       */
36      public CommentStatement(int lineNumber, String identifier) {
37          this(lineNumber, identifier, "");
38      }
39      
40      public CommentStatement(int lineNumber) {
41          this(lineNumber, COMMENT_ID + lineNumber, "");
42      }
43      
44      public void setComment(String comment) {
45          this.comment = comment;
46      }
47      
48      public String getComment() {
49          return comment;
50      }
51  
52      public void attachComment(CommentStatement comment) {
53          //TODO: throw some error as one should not be able to attach comments to comments
54      }
55  }