Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *    Purpose: A Class that represents an XML Comment node and its contents,
4
 *             and can build itself from a database connection
5
 *  Copyright: 2000 Regents of the University of California and the
6
 *             National Center for Ecological Analysis and Synthesis
7
 *    Authors: Matt Jones
8
 *
9
 *   '$Author: jones $'
10
 *     '$Date: 2000-06-27 19:36:26 -0700 (Tue, 27 Jun 2000) $'
11
 * '$Revision: 219 $'
12
 */
13

    
14
package edu.ucsb.nceas.metacat;
15

    
16
/**
17
 * A Class that represents an XML Comment node and its contents,
18
 */
19
public class CommentNode extends BasicNode {
20

    
21
    private String      nodeData = null;
22

    
23
    /** 
24
     * Construct a new CommentNode instance
25
     *
26
     * @param nodeid the element_id for the node to be created
27
     * @param parentnodeid the id of the parent node
28
     * @param nodedata the text of the node
29
     * @param nodetype the type of the node
30
     */
31
    public CommentNode (long nodeid, long parentnodeid,
32
                          String nodedata) {
33
      setNodeID(nodeid);
34
      setParentID(parentnodeid);
35
      setNodeData(nodedata);
36
      setNodeType("COMMENT");
37
    }
38

    
39
    /** Set the node data to the given string */
40
    public void setNodeData(String nodedata) {
41
      this.nodeData = nodedata;
42
    }
43

    
44
    /** Get the node data as a string value */
45
    public String getNodeData() {
46
      return nodeData;
47
    }
48

    
49
    /** 
50
     * String representation of this text node
51
     */
52
    public String toString () {
53
        return ("<!-- " + nodeData + " -->");
54
    }
55
}
56

    
57
/**
58
 * '$Log$
59
 */
(6-6/25)