KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jdiff > SingleComment


1 package jdiff;
2
3 import java.io.*;
4 import java.util.*;
5
6 /**
7  * Represents a single comment element. Has an identifier and some text.
8  *
9  * See the file LICENSE.txt for copyright details.
10  * @author Matthew Doar, doar@pobox.com
11  */

12 class SingleComment implements Comparable JavaDoc {
13
14     /** The identifier for this comment. */
15     public String JavaDoc id_ = null;
16
17     /** The text of this comment. */
18     public String JavaDoc text_ = null;
19
20     /** If false, then this comment is inactive. */
21     public boolean isUsed_ = true;
22
23     public SingleComment(String JavaDoc id, String JavaDoc text) {
24         id_ = id;
25         text_ = text;
26     }
27
28     /** Compare two SingleComment objects using just the id. */
29     public int compareTo(Object JavaDoc o) {
30         return id_.compareTo(((SingleComment)o).id_);
31     }
32 }
33
Popular Tags