Project

General

Profile

1 219 jones
/**
2
 *  '$RCSfile$'
3
 *    Purpose: A Class that represents an XML PI 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$'
10
 *     '$Date$'
11
 * '$Revision$'
12 669 jones
 *
13
 * This program is free software; you can redistribute it and/or modify
14
 * it under the terms of the GNU General Public License as published by
15
 * the Free Software Foundation; either version 2 of the License, or
16
 * (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 219 jones
 */
27
28
package edu.ucsb.nceas.metacat;
29
30
/**
31
 * A Class that represents an XML PI node and its contents,
32
 */
33
public class PINode extends BasicNode {
34
35
    private String      nodeData = null;
36
37
    /**
38
     * Construct a new PINode instance
39
     *
40
     * @param nodeid the id for the node to be created
41
     * @param parentnodeid the id of the parent node
42
     * @param nodename the name of the PI node
43
     * @param nodedata the contents of the PI node
44
     */
45
    public PINode (long nodeid, long parentnodeid, String nodename,
46
                          String nodedata) {
47
      setNodeID(nodeid);
48
      setParentID(parentnodeid);
49
      setTagName(nodename);
50
      setNodeData(nodedata);
51
      setNodeType("PI");
52
    }
53
54
    /** Set the node data to the given string */
55
    public void setNodeData(String nodedata) {
56
      this.nodeData = nodedata;
57
    }
58
59
    /** Get the node data as a string value */
60
    public String getNodeData() {
61
      return nodeData;
62
    }
63
64
    /**
65
     * String representation of this text node
66
     */
67
    public String toString () {
68
        return ("<?" + getTagName() + " " + nodeData + " ?>");
69
    }
70
}
71
72
/**
73
 * '$Log$
74 3077 jones
 * 'Revision 1.3  2001/01/18 19:51:59  jones
75
 * 'Added license terms to source code files, and cleaned up some javadoc
76
 * 'documentation in a few places.
77
 * '
78 669 jones
 * 'Revision 1.2  2000/08/14 20:53:34  jones
79
 * 'Added "release" keyword to all metacat source files so that the release
80
 * 'number will be evident in software distributions.
81
 * '
82 349 jones
 * 'Revision 1.1  2000/06/28 02:36:26  jones
83
 * 'Added feature to now ouput COMMENTs and PIs when the document is
84
 * 'read from the database with DBReader.
85
 * '
86 219 jones
 */