KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > lib > cvsclient > command > annotate > AnnotateLine


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.lib.cvsclient.command.annotate;
20
21 import java.text.*;
22 import java.util.*;
23
24 /**
25  * @author Thomas Singer
26  */

27 public class AnnotateLine {
28
29     private static final DateFormat DATE_FORMAT = new SimpleDateFormat("dd-MMM-yy", //NOI18N
30
Locale.US);
31
32     private String JavaDoc author;
33     private String JavaDoc revision;
34     private Date date;
35     private String JavaDoc dateString;
36     private String JavaDoc content;
37     private int lineNum;
38
39     public AnnotateLine() {
40     }
41
42     /**
43      * Returns the author of this line.
44      */

45     public String JavaDoc getAuthor() {
46         return author;
47     }
48
49     /**
50      * Sets the author of this line.
51      */

52     public void setAuthor(String JavaDoc author) {
53         this.author = author;
54     }
55
56     /**
57      * Returns the revision of this line.
58      */

59     public String JavaDoc getRevision() {
60         return revision;
61     }
62
63     /**
64      * Sets the revision of this line.
65      */

66     public void setRevision(String JavaDoc revision) {
67         this.revision = revision;
68     }
69
70     /**
71      * Returns the date of this line.
72      */

73     public Date getDate() {
74         return date;
75     }
76
77     /**
78      * Returns the date in original String-representation of this line.
79      */

80     public String JavaDoc getDateString() {
81         return dateString;
82     }
83
84     /**
85      * Sets the date of this line.
86      */

87     public void setDateString(String JavaDoc dateString) {
88         this.dateString = dateString;
89         try {
90             this.date = DATE_FORMAT.parse(dateString);
91         }
92         catch (ParseException ex) {
93             // print stacktrace, because it's a bug
94
ex.printStackTrace();
95         }
96     }
97
98     /**
99      * Return the line's content.
100      */

101     public String JavaDoc getContent() {
102         return content;
103     }
104
105     /**
106      * Sets the line's content.
107      */

108     public void setContent(String JavaDoc content) {
109         this.content = content;
110     }
111
112     /**
113      * Returns the line's number. It's 1 based.
114      */

115     public int getLineNum() {
116         return lineNum;
117     }
118
119     /**
120      * Returns the line's number.
121      */

122     public Integer JavaDoc getLineNumInteger() {
123         return new Integer JavaDoc(lineNum);
124     }
125
126     /**
127      * Sets the line's number.
128      */

129     public void setLineNum(int lineNum) {
130         this.lineNum = lineNum;
131     }
132 }
Popular Tags