Revision 31
Added by Matt Jones over 24 years ago
BasicElement.java | ||
---|---|---|
14 | 14 |
import java.util.Hashtable; |
15 | 15 |
import java.util.Enumeration; |
16 | 16 |
|
17 |
/** A Class that represents an XML element and its contents */ |
|
17 | 18 |
public class BasicElement { |
18 | 19 |
|
19 | 20 |
private long element_id; |
... | ... | |
22 | 23 |
private long parent_id; |
23 | 24 |
private Hashtable attributes; |
24 | 25 |
|
26 |
/** Construct a Basic Element */ |
|
25 | 27 |
public BasicElement () { |
26 | 28 |
content = new StringBuffer(); |
27 | 29 |
attributes = new Hashtable(); |
28 | 30 |
} |
29 | 31 |
|
32 |
/** Construct a Basic Element |
|
33 |
* |
|
34 |
* @param tagname the name of the element |
|
35 |
* @param parent_id the id number of the parent element |
|
36 |
*/ |
|
30 | 37 |
public BasicElement (String tagname, long parent_id) { |
31 | 38 |
this(); |
32 | 39 |
this.tagname = tagname; |
33 | 40 |
this.parent_id = parent_id; |
34 | 41 |
} |
35 | 42 |
|
43 |
/** Construct a Basic Element |
|
44 |
* |
|
45 |
* @param element_id the id number of the element |
|
46 |
* @param tagname the name of the element |
|
47 |
* @param parent_id the id number of the parent element |
|
48 |
*/ |
|
36 | 49 |
public BasicElement (long element_id, String tagname, long parent_id) { |
37 | 50 |
this(tagname,parent_id); |
38 | 51 |
this.element_id = element_id; |
39 | 52 |
} |
40 | 53 |
|
41 |
// used by JTree to display this node
|
|
54 |
/** convert the element to a string representation for display */
|
|
42 | 55 |
public String toString () |
43 | 56 |
{ |
44 | 57 |
StringBuffer value = new StringBuffer(); |
... | ... | |
136 | 149 |
public String getContent() { |
137 | 150 |
return this.content.toString(); |
138 | 151 |
} |
139 |
|
|
140 | 152 |
} |
Also available in: Unified diff
documentation additions