Project

General

Profile

1
/**
2
 *      Name: TextNode.java
3
 *   Purpose: A Class that represents an XML Text 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
 *   Version: '$Id: TextNode.java 168 2000-06-16 03:20:41Z jones $'
10
 */
11

    
12
package edu.ucsb.nceas.metacat;
13

    
14
/**
15
 * A Class that represents an XML Text node and its contents,
16
 */
17
public class TextNode extends BasicNode {
18

    
19
    private String      nodeData = null;
20

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

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

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

    
47
    /** 
48
     * String representation of this text node
49
     */
50
    public String toString () {
51
        return nodeData;
52
    }
53
}
(19-19/20)